mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-18 15:55:30 +00:00
fix: ResourceAwardEmojis API wasn't properly filtering based on awardId
This commit is contained in:
parent
e9c8bb811c
commit
70f43152e6
@ -1,16 +1,16 @@
|
||||
import URLJoin from 'url-join';
|
||||
import { BaseService, RequestHelper } from '../infrastructure';
|
||||
|
||||
function url(projectId, resourceType, resourceId, noteId) {
|
||||
function url(projectId, resourceType, resourceId, awardId, noteId) {
|
||||
const [pId, rId] = [projectId, resourceId].map(encodeURIComponent);
|
||||
let output = `${pId}/${resourceType}/${rId}/`;
|
||||
|
||||
if (noteId) {
|
||||
output += `notes/${encodeURIComponent(noteId)}/`;
|
||||
}
|
||||
if (noteId) output += `notes/${encodeURIComponent(noteId)}/`;
|
||||
|
||||
output += 'award_emoji';
|
||||
|
||||
if (awardId) output += `/${encodeURIComponent(awardId)}/`;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
@ -24,22 +24,25 @@ class ResourceAwardsEmojis extends BaseService {
|
||||
this.resourceType = resourceType;
|
||||
}
|
||||
|
||||
all(projectId, resourceId, options, noteId) {
|
||||
return RequestHelper.get(this, url(projectId, this.resourceType, resourceId, noteId), options);
|
||||
all(projectId, resourceId, noteId) {
|
||||
return RequestHelper.get(this, url(projectId, this.resourceType, resourceId, null, noteId));
|
||||
}
|
||||
|
||||
award(projectId, resourceId, name, noteId) {
|
||||
return RequestHelper.post(this, url(projectId, this.resourceType, resourceId, noteId), {
|
||||
return RequestHelper.post(this, url(projectId, this.resourceType, resourceId, null, noteId), {
|
||||
name,
|
||||
});
|
||||
}
|
||||
|
||||
remove(projectId, resourceId, awardId, noteId) {
|
||||
return RequestHelper.delete(this, url(projectId, this.resourceType, resourceId, noteId));
|
||||
return RequestHelper.delete(
|
||||
this,
|
||||
url(projectId, this.resourceType, resourceId, awardId, noteId),
|
||||
);
|
||||
}
|
||||
|
||||
show(projectId, resourceId, awardId, noteId) {
|
||||
return RequestHelper.get(this, url(projectId, this.resourceType, resourceId, noteId));
|
||||
return RequestHelper.get(this, url(projectId, this.resourceType, resourceId, awardId, noteId));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user