leantime icon indicating copy to clipboard operation
leantime copied to clipboard

[BUG] API Add comment exception

Open JeromePTI opened this issue 1 year ago • 2 comments

When calling the addComment API, it throws an exception :

ErrorException: Warning: Attempt to read property "type" on string

The bug is in : app/Domain/Comments/Services/Comments.php

https://github.com/Leantime/leantime/blob/5c4956c9e67aa2836aac1770edace33d04e6aca0/app/Domain/Comments/Services/Comments.php#L84C195-L84C197

$entity is a string, not an object, while called by API

JeromePTI avatar Dec 28 '23 16:12 JeromePTI

When creating ticket comments the service method expects the entity to be a ticket object. Can you pass in the ticket as json object?

marcelfolaron avatar Jan 04 '24 20:01 marcelfolaron

Thanks for your reply

Last week I tried to pass in the ticket as json object but it doesn't work, I got the same exception

JeromePTI avatar Jan 05 '24 08:01 JeromePTI