#Ticket lock error
21 messages · Page 1 of 1 (latest)
I'm trying to lock a channel. It works when I only have one ticket created, but as soon as I create another one, the lock/unlock stops working.
Here is my code : https://pastebin.com/xSeMMnhF
("bloquer" mean "lock", and "debloquer" means "unlock")
I do not get any errors.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Please ?
What happens when you click the lock/unlock buttons then? In what way aren’t they working?
When I click the lock button, it send the embed that confirms the lock. But the users can still talk.
And when I try to unlock it, it says it's already unlocked.
I think it might be a problem when changing the value of "Locked" in the databse from false to true, but I have no clue how to fix that in the code
console.log(data) in your callback before the switch there and either you see yourself where the issue is in there or show the result of the log
That is what I get when logging data
model {$__: InternalCache, $isNew: false, _doc: {…}, $init: true}
Btw don't hesitate to ping me when you answer so I can reply quicker
Why is it a model and not a document?
Tbh, can’t tell you 
Is that mongoose or what library do you use for your db?
Yes mongoose
Must be an older version then, since current versions don’t support callback like that anymore and all use promise returns instead
I’m following a tutorial so I’m not 100% sure about everything I write
Could you help me solve that ?
npm ls mongoose
Oh I forgot I have to go, I’ll ping you later today
Don’t ping. Just write in this post without reply/ping
Okay sure
Okay I'm back, here are the results for npm ls mongoose :
[email protected] C:\Users...\Desktop...
└── [email protected]