summaryrefslogtreecommitdiff
path: root/src/services/note
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/note')
-rw-r--r--src/services/note/unwatch.ts9
1 files changed, 9 insertions, 0 deletions
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
+ });
+};