diff --git a/client/src/util/gitea.js b/client/src/util/gitea.js index 186600c..b8c772a 100644 --- a/client/src/util/gitea.js +++ b/client/src/util/gitea.js @@ -11,14 +11,15 @@ export class GiteaClient { fetchIssues(project, page = 1) { return fetch(`/gitea/api/v1/repos/${project}/issues?page=${page}`) .then(this.assertAuthorization) + .then(this.assertOk) .then(res => res.json()) ; } fetchUserProjects() { return fetch(`/gitea/api/v1/user/repos`) - .then(this.assertOk) .then(this.assertAuthorization) + .then(this.assertOk) .then(res => res.json()) ; } @@ -31,15 +32,15 @@ export class GiteaClient { }, body: JSON.stringify({ labels: [labelID] }), }) - .then(this.assertOk) .then(this.assertAuthorization) + .then(this.assertOk) .then(res => res.json()) } fetchProjectLabels(project) { return fetch(`/gitea/api/v1/repos/${project}/labels`) - .then(this.assertOk) .then(this.assertAuthorization) + .then(this.assertOk) .then(res => res.json()) ; } @@ -48,8 +49,8 @@ export class GiteaClient { return fetch(`/gitea/api/v1/repos/${project}/issues/${issueNumber}/labels/${labelID}`, { method: 'DELETE' }) - .then(this.assertOk) .then(this.assertAuthorization) + .then(this.assertOk) } createIssue(project, title, body, labelID) { @@ -64,8 +65,8 @@ export class GiteaClient { labels: [labelID], }), }) - .then(this.assertOk) .then(this.assertAuthorization) + .then(this.assertOk) .then(res => res.json()) }