|
|
@ -120,9 +120,8 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { title, daysAgo } from './filter'; |
|
|
|
import { newHttpClient } from './http'; |
|
|
|
import { rootUrl, newHttpClient } from './http'; |
|
|
|
|
|
|
|
const baseUrl = window.location.href.split('/').slice(0, 3).join('/'); |
|
|
|
const httpClient = newHttpClient(); |
|
|
|
|
|
|
|
export default { |
|
|
@ -153,8 +152,8 @@ export default { |
|
|
|
|
|
|
|
created() { |
|
|
|
Promise.all([ |
|
|
|
httpClient.get(`${baseUrl}/v1/projects`), |
|
|
|
httpClient.get(`${baseUrl}/v1/me`), |
|
|
|
httpClient.get(`${rootUrl}/v1/projects`), |
|
|
|
httpClient.get(`${rootUrl}/v1/me`), |
|
|
|
]).then(([projects, me]) => { |
|
|
|
this.items = projects.data; |
|
|
|
this.username = me.data.username; |
|
|
@ -164,7 +163,7 @@ export default { |
|
|
|
|
|
|
|
methods: { |
|
|
|
deleteProject() { |
|
|
|
httpClient.delete(`${baseUrl}/v1/projects/${this.project.id}`).then(() => { |
|
|
|
httpClient.delete(`${rootUrl}/v1/projects/${this.project.id}`).then(() => { |
|
|
|
this.isDelete = false; |
|
|
|
const index = this.items.indexOf(this.project); |
|
|
|
this.items.splice(index, 1); |
|
|
@ -198,9 +197,9 @@ export default { |
|
|
|
guideline: 'Please write annotation guideline.', |
|
|
|
resourcetype: this.resourceType(), |
|
|
|
}; |
|
|
|
httpClient.post(`${baseUrl}/v1/projects`, payload) |
|
|
|
httpClient.post(`${rootUrl}/v1/projects`, payload) |
|
|
|
.then((response) => { |
|
|
|
window.location = `${baseUrl}/projects/${response.data.id}/docs/create`; |
|
|
|
window.location = `${rootUrl}/projects/${response.data.id}/docs/create`; |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
this.projectTypeError = ''; |
|
|
|