feat(managers/viewer): add views the viewer's payload

This commit is contained in:
Aminejv 2022-09-12 12:28:57 +01:00
parent 5c50b7652a
commit f38957b6b9
2 changed files with 15 additions and 1 deletions

View File

@ -107,6 +107,13 @@ import createDeal from "~/node_common/data/methods/create-deal";
// Surveys
import createSurvey from "~/node_common/data/methods/create-survey";
// NOTE(amine)
// Views
import getViewById from "~/node_common/data/methods/get-view-by-id";
import getViewsByUserId from "~/node_common/data/methods/get-views-by-user-id";
import createView from "~/node_common/data/methods/create-view";
import deleViewById from "~/node_common/data/methods/delete-view-by-id";
export {
// NOTE(jim): One-offs
createOrphan,
@ -191,4 +198,9 @@ export {
createDeal,
//NOTE(amine): Surveys
createSurvey,
//NOTE(amine): Views
getViewsByUserId,
getViewById,
createView,
deleViewById,
};

View File

@ -152,9 +152,10 @@ export const getById = async ({ id }) => {
// user.library = await Data.getFilesByUserId({ id });
const [slates, keys, subscriptions, following, followers] = (
const [slates, views, keys, subscriptions, following, followers] = (
await Promise.allSettled([
Data.getSlatesByUserId({ ownerId: id, includeFiles: true }),
Data.getViewsByUserId({ ownerId: id }),
Data.getAPIKeysByUserId({ userId: id }),
Data.getSubscriptionsByUserId({ ownerId: id }),
Data.getFollowingByUserId({ ownerId: id }),
@ -224,6 +225,7 @@ export const getById = async ({ id }) => {
// userBucketCID: bucketRoot?.path || null,
keys,
slates,
views,
subscriptions,
following,
followers,