mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 08:10:28 +09:00
공개 키 등록 구현
This commit is contained in:
1 parent
dec17ecba8
commit
c00dbe7024
8 files changed
+82
-4
No files matched your search
@@ -0,0 +1,10 @@
|
||||
import { error } from "@sveltejs/kit";
|
||||
import { createClient, getClientByPubKey } from "$lib/server/db/client";
|
||||
|
||||
export const registerPubKey = async (userId: number, pubKey: string) => {
|
||||
if (await getClientByPubKey(pubKey)) {
|
||||
error(409, "Public key already registered");
|
||||
}
|
||||
|
||||
await createClient(pubKey, userId);
|
||||
};
|
||||
Reference in new issue
Block a user