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
@unicodeveloper ping!
Are you using the php sdk? If you are, which of the delete methods there are you using?
hi, yes, I am using the delete method of MakeHttpRequest and the cancelEvent of ManagesTriggers
Okay, what error does the cancelEvent return?
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
you are creating a new trigger with the cancelEvent?
no, this is in the cancelEvent body
@Lena_Dooms, you just advanced to level 1!
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
yes, exactly
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
will do, thanks for your time!