Add color_id argument to tag API procedures

Fixes #4592
This commit is contained in:
Frédéric Guillot 2023-02-14 20:45:07 -08:00 committed by Frédéric Guillot
parent d0941ccd4e
commit 31408f53aa
1 changed files with 4 additions and 4 deletions

View File

@ -24,16 +24,16 @@ class TagProcedure extends BaseProcedure
return $this->tagModel->getAllByProject($project_id);
}
public function createTag($project_id, $tag)
public function createTag($project_id, $tag, $color_id = null)
{
ProjectAuthorization::getInstance($this->container)->check($this->getClassName(), 'createTag', $project_id);
return $this->tagModel->findOrCreateTag($project_id, $tag);
return $this->tagModel->create($project_id, $tag, $color_id);
}
public function updateTag($tag_id, $tag)
public function updateTag($tag_id, $tag, $color_id = null)
{
TagAuthorization::getInstance($this->container)->check($this->getClassName(), 'updateTag', $tag_id);
return $this->tagModel->update($tag_id, $tag);
return $this->tagModel->update($tag_id, $tag, $color_id);
}
public function removeTag($tag_id)