Skip to content

Commit

Permalink
fix: bcf service methods
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Apr 26, 2022
1 parent d5d2ba3 commit 2b40da0
Showing 1 changed file with 6 additions and 30 deletions.
36 changes: 6 additions & 30 deletions src/services/BcfService.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,18 @@ class BcfService {

async createFullTopic(project, topic) {
try {
await fetch(
`${process.env.VUE_APP_API_BASE_URL}/bcf/2.1/projects/${project.id}/full-topic`,
{
method: "POST",
headers: {
"content-type": "application/json",
...apiClient.authHeader
},
body: JSON.stringify(topic)
}
);
return await apiClient.bcfApi.createFullTopic(project.id, topic);
} catch (error) {
console.log(error);
}
}

async updateFullTopic(project, topic, data) {
try {
return await fetch(
`${process.env.VUE_APP_API_BASE_URL}/bcf/2.1/projects/${project.id}/full-topic/${topic.guid}`,
{
method: "PATCH",
headers: {
"content-type": "application/json",
...apiClient.authHeader
},
body: JSON.stringify(data)
}
return await apiClient.bcfApi.updateFullTopic(
topic.guid,
project.id,
data
);
} catch (error) {
console.log(error);
Expand Down Expand Up @@ -113,15 +97,7 @@ class BcfService {

async exportBcf(project) {
try {
return await fetch(
`${process.env.VUE_APP_API_BASE_URL}/bcf/2.1/projects/${project.id}/export`,
{
method: "GET",
headers: {
...apiClient.authHeader
}
}
);
return await apiClient.bcfApi.downloadBcfExport(project.id);
} catch (error) {
console.log(error);
}
Expand Down

0 comments on commit 2b40da0

Please sign in to comment.