공개 키 등록 구현

This commit is contained in:
static
2024-12-28 01:05:31 +09:00
parent dec17ecba8
commit c00dbe7024
8 changed files with 82 additions and 4 deletions

View File

@@ -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);
};