Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
Fix Nathanael issuesTags
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpyle committed Nov 21, 2019
1 parent c770da4 commit d78a420
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions app/components/SubmitHelpTicket.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,21 @@ async function postAttachmentsToIssue(
async function postTagsToIssue(issue) {
const NATHANAEL_TAG_ID = '5-170';
try {
const json = { issues: [{ id: issue.id }] };
const getRequestOptions = {
method: 'GET',
headers: {
Authorization: `Bearer ${config.token}`,
Accept: 'application/json'
}
};
const getResponse = await fetch(
`${config.baseUrl}/api/issueTags/${NATHANAEL_TAG_ID}/issues?fields=id`,
getRequestOptions
);
const nathanaelTaggedIssues = await servicesHelpers
.handleResponseAsReadable(getResponse)
.json();
const json = { issues: [{ id: issue.id }, ...nathanaelTaggedIssues] };
const requestOptions = {
method: 'POST',
headers: {
Expand All @@ -229,11 +243,14 @@ async function postTagsToIssue(issue) {
const fields =
'name,issues,color,untagOnResolve,owner,visibleFor,updateableBy';
const query = `fields=${fields}`;
const response = await fetch(
const postResponse = await fetch(
`${config.baseUrl}/api/issueTags/${NATHANAEL_TAG_ID}?${query}`,
requestOptions
);
return response;
const postJson = await servicesHelpers
.handleResponseAsReadable(postResponse)
.json();
return postJson;
} catch (error) {
log.error(error);
}
Expand Down

0 comments on commit d78a420

Please sign in to comment.