mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
implemented has
method
This commit is contained in:
parent
5dcc721bc6
commit
ca6aa521c0
@ -114,4 +114,21 @@ export default class SecureSyncEntry {
|
||||
|
||||
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