diff --git a/src/models/post.ts b/src/models/post.ts index e035a70..31db0a1 100644 --- a/src/models/post.ts +++ b/src/models/post.ts @@ -88,7 +88,7 @@ const PostSchema = new Schema({ }); -PostSchema.method('remove', async function remove(reason) { +PostSchema.method('del', async function del(reason: string) { this.removed = true; this.removed_reason = reason; await this.save(); diff --git a/src/services/api/routes/posts.ts b/src/services/api/routes/posts.ts index 93a94b3..7ae813d 100644 --- a/src/services/api/routes/posts.ts +++ b/src/services/api/routes/posts.ts @@ -53,7 +53,7 @@ router.post('/:post_id.delete', async function (request: express.Request, respon } if (post.pid === userContent.pid) { - await post.remove('User requested removal'); + await post.del('User requested removal'); response.sendStatus(200); } else { response.sendStatus(401); diff --git a/src/types/mongoose/post.ts b/src/types/mongoose/post.ts index 916e20e..49731c9 100644 --- a/src/types/mongoose/post.ts +++ b/src/types/mongoose/post.ts @@ -40,7 +40,7 @@ export interface IPost { } export interface IPostMethods { - remove(reason: string): Promise; + del(reason: string): Promise; generatePostUID(length: number): Promise; cleanedBody(): string; cleanedMiiData(): string;