Started work on toke logic

This commit is contained in:
rainbow napkin 2024-12-13 18:28:48 -05:00
parent 5fe1620c20
commit d85f906a69
7 changed files with 160 additions and 16 deletions

View file

@ -25,7 +25,7 @@ const {userModel} = require('../userSchema');
const permissionModel = require('../permissionSchema');
const channelPermissionSchema = require('./channelPermissionSchema');
const channelBanSchema = require('./channelBanSchema');
const { exceptionHandler } = require('../../utils/loggerUtils');
const { exceptionHandler, errorHandler } = require('../../utils/loggerUtils');
const channelSchema = new mongoose.Schema({
id: {
@ -538,7 +538,7 @@ channelSchema.methods.nuke = async function(confirm){
}
//Annoyingly there isnt a good way to do this from 'this'
var oldChan = await module.exports.deleteOne({_id: this._id});
var oldChan = await this.deleteOne();
if(oldChan.deletedCount == 0){
throw new Error("Server Error: Unable to delete channel! Please report this error to your server administrator, and with timestamp.");