Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
Application: Switched from delete & push to replcae
Browse files Browse the repository at this point in the history
  • Loading branch information
Cpt-Dingus committed Aug 14, 2023
1 parent 52f31ea commit 84b044a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/modules/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,11 @@ application.registerSubModule(

// Sets the status to denied and pushes it to the db
locatedApplication.status = 'Denied';
await applicationCollection.deleteOne({_id: locatedApplication._id});
await applicationCollection.insertOne(locatedApplication);
await applicationCollection.replaceOne(
{_id: locatedApplication._id},
locatedApplication,
{upsert: true}
);

if (silentFlag !== true) {
// Catches all errors since the only possible one is that the user has disabled dms
Expand Down

0 comments on commit 84b044a

Please sign in to comment.