From 37999f4af7ac88e57ae814d64e7e4cb67194fcc6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 6 Nov 2018 14:58:20 +0900 Subject: [API] Implement notes/watching/ --- src/services/note/unwatch.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/services/note/unwatch.ts (limited to 'src/services') diff --git a/src/services/note/unwatch.ts b/src/services/note/unwatch.ts new file mode 100644 index 0000000000..ef5783231b --- /dev/null +++ b/src/services/note/unwatch.ts @@ -0,0 +1,9 @@ +import * as mongodb from 'mongodb'; +import Watching from '../../models/note-watching'; + +export default async (me: mongodb.ObjectID, note: object) => { + await Watching.remove({ + noteId: (note as any)._id, + userId: me + }); +}; -- cgit v1.2.3-freya