Coder Social home page Coder Social logo

clockify-api's Introduction

clockify-api's People

Contributors

godbout avatar jdecool avatar swilla avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

clockify-api's Issues

How to create a Task on a Project using Laravel?

I am trying to build a Laravel App that communicates with Clockify. I figured out looking at the documentation how the get works and I've been able to see all the workspaces, projects and tasks already created but I am struggling trying to create a task for a project from my Laravel App.
This is the store method

public function store()  { 
    $builder = new ClientBuilder();
    $client = $builder->createClientV1(config('clockify.clockify_api_key'));

    $request = new Task\TaskRequest('',\request('name'),'','','');
    $task = new Task\Task($builder->createClientV1(config('clockify.clockify_api_key')));

    $task->create(\request('workspace'),\request('project'),$request);
    dd($task);
}

This is the form

<form action="{{route('tasks.store',['workspace'=>request('workspace'),'project'=>request('project')])}}" method="POST">
          
    <div class="form-group">
        <input class="form-control" type="text" name="name" placeholder="Task Name">
    </div>

    <div class="form-group">
        <button class="btn btn-primary" type="submit">Create</button>
    </div>
</form>

And I am getting
image

Bug http_build_query

        $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

$projectsIds, $tagsIds and $taskId must be nullable in TimeEntryDtoImpl

If I don't use projects, tags or tasks in Clockify, the TimeEntryDto is not working, it gives must the following error :

JDecool\Clockify\Model\TimeEntryDtoImpl::__construct(): Argument #6 ($tagIds) must be of type array, null given

In order to make it works, I've done the following changes :

public function __construct(
        bool $billable,
        string $description,
        string $id,
        bool $isLocked,
        $projectId,
        $tagIds=[],
        $taskId,
        TimeIntervalDto $timeInterval,
        string $userId,
        string $workspaceId
    ) {
        ...
    }

update php-http/client-common to ^2.0

was trying to do a PR draft but can't find the option?

anyways, would you be willing to bump your php-http/client-common to ^2.0. i'd love to use your package for my Alfred-Time Workflow, but there's a conflict related to the php-http/client-common version. i use the latest one while you use an old one.

if you're ok with bumping up your dependency, then i'll do a PR.

thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.