mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-28 05:52:49 +03:00
23 lines
524 B
JavaScript
23 lines
524 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 subscriptions = await DB.from("subscriptions")
|
|
.where({ target_slate_id: id })
|
|
.del();
|
|
|
|
const data = await DB.from("slates").where({ id }).del();
|
|
|
|
return 1 === data;
|
|
},
|
|
errorFn: async (e) => {
|
|
return {
|
|
error: true,
|
|
decorator: "DELETE_SLATE_BY_ID",
|
|
};
|
|
},
|
|
});
|
|
};
|