add memo search to find function, update placeholder in admin

This commit is contained in:
einhorn_b 2023-08-11 20:24:43 +02:00
parent 9837014088
commit 5c5f1ebc9c
4 changed files with 15 additions and 5 deletions

View File

@ -5,7 +5,7 @@
type="text"
class="test-input-criteria"
v-model="currentValue"
:placeholder="$t('user_search')"
:placeholder="$t('user_memo_search')"
></b-form-input>
<b-input-group-append class="test-click-clear-criteria" @click="currentValue = ''">
<b-input-group-text class="pointer">

View File

@ -217,5 +217,6 @@
},
"user_deleted": "Nutzer ist gelöscht.",
"user_recovered": "Nutzer ist wiederhergestellt.",
"user_search": "Nutzer-Suche"
"user_search": "Nutzer-Suche",
"user_memo_search": "Nutzer-Kommentar-Suche"
}

View File

@ -217,5 +217,6 @@
},
"user_deleted": "User is deleted.",
"user_recovered": "User is recovered.",
"user_search": "User search"
"user_search": "User search",
"user_memo_search": "User and Memo search"
}

View File

@ -33,8 +33,8 @@ export const findContributions = async (
...(statusFilter?.length && { contributionStatus: In(statusFilter) }),
...(userId && { userId }),
}
const where =
let where =
query && relations?.user
? [
{
@ -57,8 +57,16 @@ export const findContributions = async (
},
},
},
{
...requiredWhere,
memo: Like(`%${query}%`)
},
]
: requiredWhere
if (!relations?.user && query) {
where = [{...requiredWhere, memo: Like(`%${query}%`)}]
}
return DbContribution.findAndCount({
relations,