Skip to content

Commit

Permalink
feat: award emojis on issues
Browse files Browse the repository at this point in the history
methods addAwardEmoji() to append an emoji on an issue, and showNoteAwardEmoji() and addNoteAwardEmoji() to see and append emoji on comments on an issue
  • Loading branch information
Cerdic committed Feb 19, 2024
1 parent 93f0181 commit f6df1ff
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/Api/Issues.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,18 @@ public function awardEmoji($project_id, int $issue_iid)
return $this->get($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/award_emoji'));
}

/**
* @param int|string $project_id
* @param int $issue_iid
* @param string $name
*
* @return mixed
*/
public function addAwardEmoji($project_id, int $issue_iid, string $name)
{
return $this->post($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/award_emoji'), ['name' => $name]);
}

/**
* @param int|string $project_id
* @param int $issue_iid
Expand All @@ -398,6 +410,30 @@ public function removeAwardEmoji($project_id, int $issue_iid, int $award_id)
return $this->delete($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/award_emoji/'.self::encodePath($award_id)));
}

/**
* @param int|string $project_id
* @param int $issue_iid
* @param int $note_id
*
* @return mixed
*/
public function showNoteAwardEmoji($project_id, int $issue_iid, int $note_id)
{
return $this->get($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/notes/'.self::encodePath($note_id).'/award_emoji'));
}

/**
* @param int|string $project_id
* @param int $issue_iid
* @param string $name
*
* @return mixed
*/
public function addNoteAwardEmoji($project_id, int $issue_iid, int $note_id, string $name)
{
return $this->post($this->getProjectPath($project_id, 'issues/'.self::encodePath($issue_iid).'/notes/'.self::encodePath($note_id).'/award_emoji'), ['name' => $name]);
}

/**
* @param int|string $project_id
* @param int $issue_iid
Expand Down

0 comments on commit f6df1ff

Please sign in to comment.