clockify-api icon indicating copy to clipboard operation
clockify-api copied to clipboard

Bug http_build_query

Open XNicON opened this issue 4 years ago • 3 comments

        $user = $apiFactory->userApi();
        $timesApi = $apiFactory->timeEntryApi();

        $search = [
            'project-required' => false,
            'task-required' => false,
        ];

        $timeItems = $timesApi->find($_ENV['C_SPACE_ID'], $user->current()->id(), $search);

Crete next url:

/time-entriesproject-required=0&task-required=0

XNicON avatar Oct 01 '21 14:10 XNicON

Hi @XNicON,

thanks for your feedback.

Could you give more information about what you expected ?

According to the documentation, in a query path boolean variable are converted in integer value 0 or 1.

jdecool avatar Oct 01 '21 18:10 jdecool

Oh, Yes! it not my problem

query request is broken /time-entriesproject-required=0&task-required=0

right /time-entries?project-required=0&task-required=0

In general, a lot of errors with checking for null dropped out

    /**
     * @param string[] $tagIds
     */
    public function __construct(
        bool $billable,
        string $description,
        string $id,
        bool $isLocked,
        **?string $projectId,
        ?array $tagIds,
        ?string $taskId,**
        TimeIntervalDto $timeInterval,
        string $userId,
        string $workspaceId
    ) {

If you have time for this.

And Thank you very much for making this library, it helped me a lot, optimize my work

XNicON avatar Oct 01 '21 18:10 XNicON

Oh OK.

I've just fixed the HTTP client issue in the 0.2.1.

If dedicated API resources are too buggy, I suggest you to use the generic HTTP client to make your request.

This library is WIP. And because I don't use Clockify anymore, the library development has been delayed.

jdecool avatar Oct 01 '21 20:10 jdecool