move space logic to zustand

This commit is contained in:
Ren Amamiya
2023-06-02 18:06:19 +07:00
parent dffe300a5f
commit 48e453fe5c
8 changed files with 126 additions and 42 deletions

View File

@@ -386,7 +386,7 @@ export async function getBlocks(account_id: number) {
}
// create block
export async function createBlock(
export async function addBlockToDB(
account_id: number,
kind: number,
title: string,
@@ -398,3 +398,8 @@ export async function createBlock(
[account_id, kind, title, content],
);
}
export async function removeBlockFromDB(id: string) {
const db = await connect();
return await db.execute(`DELETE FROM blocks WHERE id = "${id}";`);
}