Skip to content

Commit be50b05

Browse files
authored
Merge pull request #14 from lebedyncrs/small-fixes
Default workspace id in getCustomFields
2 parents 6e66972 + d94efcc commit be50b05

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Asana.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,7 @@ public function removeProjectToTask($taskId, $projectId = null)
276276
public function getTasksByFilter($filter = ["assignee" => "", "project" => "", "workspace" => ""])
277277
{
278278
$filter = array_filter(array_merge(["assignee" => "", "project" => "", "workspace" => ""], $filter));
279-
$url = '?' . join('&', array_map(function ($k, $v) {
280-
return "{$k}={$v}";
281-
}, array_keys($filter), $filter));
279+
$url = '?' . http_build_query($filter);
282280

283281
return $this->curl->get("tasks{$url}");
284282
}
@@ -667,8 +665,10 @@ public function getErrors()
667665
* @author Olly Warren https://github.com/ollywarren
668666
* @version 1.0
669667
*/
670-
public function getCustomFields($workspaceId)
668+
public function getCustomFields($workspaceId = null)
671669
{
670+
$workspaceId = $workspaceId ?: $this->defaultWorkspaceId;
671+
672672
return $this->curl->get("workspaces/{$workspaceId}/custom_fields");
673673
}
674674

0 commit comments

Comments
 (0)