mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-27 02:52:25 +03:00
21 lines
420 B
JavaScript
21 lines
420 B
JavaScript
import { runQuery } from "~/node_common/data/utilities";
|
|
|
|
export default async ({ id }) => {
|
|
return await runQuery({
|
|
label: "DELETE_SLATE_BY_ID",
|
|
queryFn: async (DB) => {
|
|
const data = await DB.from("slates")
|
|
.where({ id })
|
|
.del();
|
|
|
|
return 1 === data;
|
|
},
|
|
errorFn: async (e) => {
|
|
return {
|
|
error: "DELETE_SLATE_BY_ID",
|
|
source: e,
|
|
};
|
|
},
|
|
});
|
|
};
|