forked from FoundKeyGang/FoundKey
server: dont use replace for file types
No point in using replace if we already know which character we want to replace.
This commit is contained in:
parent
a7048f17f7
commit
e2ef800708
1 changed files with 1 additions and 1 deletions
|
@ -45,7 +45,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
|
|
||||||
if (ps.type) {
|
if (ps.type) {
|
||||||
if (ps.type.endsWith('/*')) {
|
if (ps.type.endsWith('/*')) {
|
||||||
query.andWhere('file.type like :type', { type: ps.type.replace('/*', '/') + '%' });
|
query.andWhere('file.type like :type', { type: ps.type.slice(0, -1) + '%' });
|
||||||
} else {
|
} else {
|
||||||
query.andWhere('file.type = :type', { type: ps.type });
|
query.andWhere('file.type = :type', { type: ps.type });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue