Skip to content
Snippets Groups Projects
Commit b22b5d45 authored by vincent.steinman's avatar vincent.steinman Committed by michael.minelli
Browse files

fix param/body for add, delete

parent e0a8926d
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ import DojoStatusCode from '../shared/types/Dojo/DojoStatusCode.js'; ...@@ -11,6 +11,7 @@ import DojoStatusCode from '../shared/types/Dojo/DojoStatusCode.js';
import * as Gitlab from '@gitbeaker/rest'; import * as Gitlab from '@gitbeaker/rest';
import DojoBackendHelper from '../sharedByClients/helpers/Dojo/DojoBackendHelper.js'; import DojoBackendHelper from '../sharedByClients/helpers/Dojo/DojoBackendHelper.js';
import GitlabPipelineStatus from '../shared/types/Gitlab/GitlabPipelineStatus.js'; import GitlabPipelineStatus from '../shared/types/Gitlab/GitlabPipelineStatus.js';
import Tags from '../sharedByClients/models/Tag';
class DojoBackendManager { class DojoBackendManager {
...@@ -248,21 +249,29 @@ class DojoBackendManager { ...@@ -248,21 +249,29 @@ class DojoBackendManager {
return false; return false;
} }
} //Around here
public async addTag(name : string, type: string) : Promise<Tags | undefined> {
return (await axios.post<DojoBackendResponse<Tags>>(this.getApiUrl(ApiRoute.ADD_TAG),{
name : name,
type :type
})).data.data;
} }
public async addTag(name : string, type: string) : Promise<User> { public async deleteTag(name : string) : Promise<Tags> {
return (await axios.post<DojoBackendResponse<User>>(this.getApiUrl(ApiRoute.ADD_TAG).replace('{{tageName}}', name).replace('{{tagType}}', type))).data.data; return (await axios.delete<DojoBackendResponse<Tags>>(this.getApiUrl(ApiRoute.DELETE_TAG).replace('{{tageName}}', name))).data.data;
}
public async deleteTag(name : string) : Promise<User> {
return (await axios.delete<DojoBackendResponse<User>>(this.getApiUrl(ApiRoute.DELETE_TAG).replace('{{tageName}}', name))).data.data;
} }
public async getProposeTag(name : string) : Promise<User> { public async getProposeTag(state : string) : Promise<Tags | undefined> {
return (await axios.get<DojoBackendResponse<User>>(this.getApiUrl(ApiRoute.PROPOSE_TAG).replace('{{tageName}}', name))).data.data; return (await axios.get<DojoBackendResponse<Tags>>(this.getApiUrl(ApiRoute.PROPOSE_TAG).replace('{{tageName}}', state))).data.data;
} }
public async postProposeTag(name : string, type: string) : Promise<User> { public async postProposeTag(name : string, type: string) : Promise<Tags | undefined> {
return (await axios.post<DojoBackendResponse<User>>(this.getApiUrl(ApiRoute.PROPOSE_TAG).replace('{{tageName}}', name).replace('{{tagType}}', type))).data.data; return (await axios.post<DojoBackendResponse<Tags>>(this.getApiUrl(ApiRoute.PROPOSE_TAG).replace('{{tageName}}', ""),{
name : name,
type :type
})).data.data;
} }
public async answerProposeTag(name : string) : Promise<User> { public async answerProposeTag(name : string, state: string) : Promise<Tags | undefined> {
return (await axios.patch<DojoBackendResponse<User>>(this.getApiUrl(ApiRoute.ANSWER_TAG_PROPOSAL).replace('{{tageName}}', name))).data.data; return (await axios.patch<DojoBackendResponse<Tags>>(this.getApiUrl(ApiRoute.ANSWER_TAG_PROPOSAL).replace('{{tagProposalName}}', name), {
state: state
})).data.data;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment