mirror of
https://github.com/PretendoNetwork/miiverse-api.git
synced 2026-08-20 07:34:06 -05:00
Post.remove() -> Post.del(), remove is used by Mongoose internally
This commit is contained in:
@@ -88,7 +88,7 @@ const PostSchema = new Schema<IPost, PostModel, IPostMethods>({
|
||||
});
|
||||
|
||||
|
||||
PostSchema.method<HydratedPostDocument>('remove', async function remove(reason) {
|
||||
PostSchema.method<HydratedPostDocument>('del', async function del(reason: string) {
|
||||
this.removed = true;
|
||||
this.removed_reason = reason;
|
||||
await this.save();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -40,7 +40,7 @@ export interface IPost {
|
||||
}
|
||||
|
||||
export interface IPostMethods {
|
||||
remove(reason: string): Promise<void>;
|
||||
del(reason: string): Promise<void>;
|
||||
generatePostUID(length: number): Promise<void>;
|
||||
cleanedBody(): string;
|
||||
cleanedMiiData(): string;
|
||||
|
||||
Reference in New Issue
Block a user