mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-20 07:32:01 +03:00
25 lines
555 B
JavaScript
25 lines
555 B
JavaScript
|
import { runQuery } from "~/node_common/data/utilities";
|
||
|
|
||
|
export default async ({ slateId }) => {
|
||
|
return await runQuery({
|
||
|
label: "GET_ACTIVITY_FOR_SLATE_ID",
|
||
|
queryFn: async (DB) => {
|
||
|
const query = await DB.select("*")
|
||
|
.from("activity")
|
||
|
.where({ owner_slate_id: slateId });
|
||
|
|
||
|
if (!query || query.error) {
|
||
|
return [];
|
||
|
}
|
||
|
|
||
|
return JSON.parse(JSON.stringify(query));
|
||
|
},
|
||
|
errorFn: async (e) => {
|
||
|
return {
|
||
|
error: "GET_ACTIVITY_FOR_SLATE_ID",
|
||
|
source: e,
|
||
|
};
|
||
|
},
|
||
|
});
|
||
|
};
|