mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 08:54:54 +00:00
Merge pull request #55 from SyncrowIOT/fixe-door-lock-issues
Fix password filtering in DoorLockService
This commit is contained in:
@ -136,7 +136,7 @@ export class DoorLockService {
|
|||||||
const passwordFiltered = passwords.result.filter(
|
const passwordFiltered = passwords.result.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
(!item.schedule_list || item.schedule_list.length === 0) &&
|
(!item.schedule_list || item.schedule_list.length === 0) &&
|
||||||
item.type === 1,
|
item.type === 0, //temp solution
|
||||||
);
|
);
|
||||||
|
|
||||||
return convertKeysToCamelCase(passwordFiltered);
|
return convertKeysToCamelCase(passwordFiltered);
|
||||||
@ -168,7 +168,7 @@ export class DoorLockService {
|
|||||||
|
|
||||||
if (passwords.result.length > 0) {
|
if (passwords.result.length > 0) {
|
||||||
const passwordFiltered = passwords.result
|
const passwordFiltered = passwords.result
|
||||||
.filter((item) => item.type === 1)
|
.filter((item) => item.type === 0) //temp solution
|
||||||
.map((password: any) => {
|
.map((password: any) => {
|
||||||
if (password.schedule_list?.length > 0) {
|
if (password.schedule_list?.length > 0) {
|
||||||
password.schedule_list = password.schedule_list.map(
|
password.schedule_list = password.schedule_list.map(
|
||||||
@ -456,7 +456,8 @@ export class DoorLockService {
|
|||||||
...(isOnline && {
|
...(isOnline && {
|
||||||
schedule_list: scheduleList,
|
schedule_list: scheduleList,
|
||||||
}),
|
}),
|
||||||
type: type === 'multiple' ? '0' : '1',
|
|
||||||
|
type: '0', //temporary solution,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user