mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
implemented has
method
This commit is contained in:
parent
13bdccd53d
commit
1f73d01e3c
@ -114,4 +114,21 @@ export default class SecureSyncEntry {
|
|||||||
|
|
||||||
return entry
|
return entry
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async has(user_id, key) {
|
||||||
|
if (!user_id) {
|
||||||
|
throw new Error("Missing user_id")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!key) {
|
||||||
|
throw new Error("Missing key")
|
||||||
|
}
|
||||||
|
|
||||||
|
const entry = await SyncEntry.findOne({
|
||||||
|
user_id,
|
||||||
|
key,
|
||||||
|
}).catch(() => null)
|
||||||
|
|
||||||
|
return !!entry
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user