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

split tag managers with tag submit manager

parent b22b5d45
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ import * as Gitlab from '@gitbeaker/rest';
import DojoBackendHelper from '../sharedByClients/helpers/Dojo/DojoBackendHelper.js';
import GitlabPipelineStatus from '../shared/types/Gitlab/GitlabPipelineStatus.js';
import Tags from '../sharedByClients/models/Tag';
import TagSubmit from '../sharedByClients/models/TagSubmit';
class DojoBackendManager {
......@@ -249,7 +250,7 @@ class DojoBackendManager {
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,
......@@ -259,21 +260,22 @@ class DojoBackendManager {
public async deleteTag(name : string) : Promise<Tags> {
return (await axios.delete<DojoBackendResponse<Tags>>(this.getApiUrl(ApiRoute.DELETE_TAG).replace('{{tageName}}', name))).data.data;
}
public async getProposeTag(state : string) : Promise<Tags | undefined> {
return (await axios.get<DojoBackendResponse<Tags>>(this.getApiUrl(ApiRoute.PROPOSE_TAG).replace('{{tageName}}', state))).data.data;
public async getProposeTag(state : string) : Promise<TagSubmit | undefined> {
return (await axios.get<DojoBackendResponse<TagSubmit>>(this.getApiUrl(ApiRoute.PROPOSE_TAG).replace('{{tagState}}', state))).data.data;
}
public async postProposeTag(name : string, type: string) : Promise<Tags | undefined> {
return (await axios.post<DojoBackendResponse<Tags>>(this.getApiUrl(ApiRoute.PROPOSE_TAG).replace('{{tageName}}', ""),{
public async postProposeTag(name : string, type: string) : Promise<TagSubmit | undefined> {
return (await axios.post<DojoBackendResponse<TagSubmit>>(this.getApiUrl(ApiRoute.PROPOSE_TAG).replace('{{tagState}}', ""),{
name : name,
type :type
})).data.data;
}
public async answerProposeTag(name : string, state: string) : Promise<Tags | undefined> {
return (await axios.patch<DojoBackendResponse<Tags>>(this.getApiUrl(ApiRoute.ANSWER_TAG_PROPOSAL).replace('{{tagProposalName}}', name), {
state: state
public async answerProposeTag(name : string, type: string, state: string, detail: string) : Promise<TagSubmit | undefined> {
return (await axios.patch<DojoBackendResponse<TagSubmit>>(this.getApiUrl(ApiRoute.ANSWER_TAG_PROPOSAL).replace('{{tagProposalName}}', name), {
type: type,
state: state,
detail: detail
})).data.data;
}
}
export default new DojoBackendManager();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment