From 1ba5dfd79c66edd871f922d21861557e6152cc6c Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 25 Apr 2018 06:34:50 +0900 Subject: [PATCH] wip --- .../desktop/views/components/lists-window.vue | 37 +++++++++++++++++++ .../endpoints/users/{list => lists}/create.ts | 0 src/server/api/endpoints/users/lists/list.ts | 13 +++++++ .../endpoints/users/{list => lists}/push.ts | 0 4 files changed, 50 insertions(+) create mode 100644 src/client/app/desktop/views/components/lists-window.vue rename src/server/api/endpoints/users/{list => lists}/create.ts (100%) create mode 100644 src/server/api/endpoints/users/lists/list.ts rename src/server/api/endpoints/users/{list => lists}/push.ts (100%) diff --git a/src/client/app/desktop/views/components/lists-window.vue b/src/client/app/desktop/views/components/lists-window.vue new file mode 100644 index 0000000000..7d6a5def2c --- /dev/null +++ b/src/client/app/desktop/views/components/lists-window.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/src/server/api/endpoints/users/list/create.ts b/src/server/api/endpoints/users/lists/create.ts similarity index 100% rename from src/server/api/endpoints/users/list/create.ts rename to src/server/api/endpoints/users/lists/create.ts diff --git a/src/server/api/endpoints/users/lists/list.ts b/src/server/api/endpoints/users/lists/list.ts new file mode 100644 index 0000000000..d19339a1f5 --- /dev/null +++ b/src/server/api/endpoints/users/lists/list.ts @@ -0,0 +1,13 @@ +import UserList, { pack } from '../../../../../models/user-list'; + +/** + * Add a user to a user list + */ +module.exports = async (params, me) => new Promise(async (res, rej) => { + // Fetch lists + const userLists = await UserList.find({ + userId: me._id, + }); + + res(await Promise.all(userLists.map(x => pack(x)))); +}); diff --git a/src/server/api/endpoints/users/list/push.ts b/src/server/api/endpoints/users/lists/push.ts similarity index 100% rename from src/server/api/endpoints/users/list/push.ts rename to src/server/api/endpoints/users/lists/push.ts