Cancel event not working

I'm working in PHP. deleting an event through ->delete("events/trigger/{$transactionId}")['data'] directly works, but using ->cancelEvent($transactionId) results in an error. From what I can see, since DELETE returns 204 with an empty response body, request() returns false. cancelEvent() then tries to create a trigger with false as first argument instead of an array, resulting in an error. Is there something I'm doing wrong? Or should I just stick to using the delete() function directly?
12 Replies
Pawan Jain
Pawan Jain2y ago
@unicodeveloper ping!
Prosper
Prosper2y ago
Are you using the php sdk? If you are, which of the delete methods there are you using?
lena_dooms
lena_dooms2y ago
hi, yes, I am using the delete method of MakeHttpRequest and the cancelEvent of ManagesTriggers
Prosper
Prosper2y ago
Okay, what error does the cancelEvent return?
lena_dooms
lena_dooms2y ago
Type error: Novu\SDK\Resources\Resource::__construct(): Argument #1 ($attributes) must be of type array, bool given in cancelEvent, response returns false. Creating a new Trigger with this results in an error
Prosper
Prosper2y ago
you are creating a new trigger with the cancelEvent?
lena_dooms
lena_dooms2y ago
no, this is in the cancelEvent body
Novu_Bot
Novu_Bot2y ago
@Lena_Dooms, you just advanced to level 1!
Prosper
Prosper2y ago
oh I get what you mean. It returns a Trigger object So the response returns a boolean value and it causes an error when it passses into the new trigger object
lena_dooms
lena_dooms2y ago
yes, exactly
Prosper
Prosper2y ago
Okay, that has to be a bug that should be fixed. Can you submit an issue to the repo ? In the meantime you can keep using delete directly
lena_dooms
lena_dooms2y ago
will do, thanks for your time!
Want results from more Discord servers?
Add your server