remove unnecessary filter

deepsource-autofix-76c6eb20
Dan Gowans 2022-09-19 11:36:57 -04:00
parent 1102a30a15
commit 3051672d84
2 changed files with 2 additions and 8 deletions

View File

@ -24,10 +24,7 @@ export const moveOccupancyTypeFieldUp = (occupancyTypeFieldId) => {
const result = database
.prepare("update OccupancyTypeFields" +
" set orderNumber = ? - 1" +
" where occupancyTypeFieldId = ?" +
(currentField.occupancyTypeId
? " and occupancyTypeId = '" + currentField.occupancyTypeId + "'"
: " and occupancyTypeId is null"))
" where occupancyTypeFieldId = ?")
.run(currentField.orderNumber, occupancyTypeFieldId);
database.close();
clearOccupancyTypesCache();

View File

@ -36,10 +36,7 @@ export const moveOccupancyTypeFieldUp = (occupancyTypeFieldId: number | string):
.prepare(
"update OccupancyTypeFields" +
" set orderNumber = ? - 1" +
" where occupancyTypeFieldId = ?" +
(currentField.occupancyTypeId
? " and occupancyTypeId = '" + currentField.occupancyTypeId + "'"
: " and occupancyTypeId is null")
" where occupancyTypeFieldId = ?"
)
.run(currentField.orderNumber, occupancyTypeFieldId);