Skip to content

Commit

Permalink
Merge pull request #5168 from bb1950328/replace-hardcoded-api-urls
Browse files Browse the repository at this point in the history
replace hard coded api urls with templated links
  • Loading branch information
BacLuc authored May 15, 2024
2 parents 439746e + 15b2eec commit fa1f708
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default {
data() {
return {
entityProperties: ['camp', 'position', 'title'],
entityUri: '/activity_progress_labels',
entityUri: '',
}
},
watch: {
Expand All @@ -53,6 +53,11 @@ export default {
}
},
},
mounted() {
this.api
.href(this.api.get(), 'activityProgressLabels')
.then((uri) => (this.entityUri = uri))
},
methods: {
createDialogActivityProgressLabelCreate() {
return this.create().then(() => {
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/campAdmin/DialogCategoryCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default {
return {
entityProperties: ['camp', 'short', 'name', 'color', 'numberingStyle'],
embeddedCollections: ['preferredContentTypes'],
entityUri: '/categories',
entityUri: '',
clipboardPermission: 'unknown',
copyCategorySource: null,
copyCategorySourceUrl: null,
Expand Down Expand Up @@ -224,6 +224,9 @@ export default {
)
},
},
mounted() {
this.api.href(this.api.get(), 'categories').then((uri) => (this.entityUri = uri))
},
methods: {
async createCategory() {
const createdCategory = await this.create()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default {
data() {
return {
entityProperties: ['camp', 'name'],
entityUri: '/material_lists',
entityUri: '',
}
},
watch: {
Expand All @@ -49,6 +49,9 @@ export default {
}
},
},
mounted() {
this.api.href(this.api.get(), 'materialLists').then((uri) => (this.entityUri = uri))
},
methods: {
createMaterialList() {
return this.create().then(() => {
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/campAdmin/DialogPeriodCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
data() {
return {
entityProperties: ['camp', 'description', 'start', 'end'],
entityUri: '/periods',
entityUri: '',
}
},
watch: {
Expand All @@ -50,6 +50,9 @@ export default {
}
},
},
mounted() {
this.api.href(this.api.get(), 'periods').then((uri) => (this.entityUri = uri))
},
methods: {
createPeriod() {
return this.create().then(() => {
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/components/collaborator/CollaboratorCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default {
data() {
return {
entityProperties: ['camp', 'inviteEmail', 'role'],
entityUri: '/camp_collaborations',
entityUri: '',
}
},
watch: {
Expand All @@ -69,6 +69,11 @@ export default {
}
},
},
mounted() {
this.api
.href(this.api.get(), 'campCollaborations')
.then((uri) => (this.entityUri = uri))
},
methods: {
createCollaboration() {
return this.create().then(() => {
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/components/collaborator/CollaboratorEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default {
resendingEmail: false,
emailSent: false,
entityProperties: ['camp', 'inviteEmail', 'role', 'status'],
entityUri: '/camp_collaborations',
entityUri: '',
}
},
computed: {
Expand Down Expand Up @@ -195,6 +195,11 @@ export default {
}
},
},
mounted() {
this.api
.href(this.api.get(), 'campCollaborations')
.then((uri) => (this.entityUri = uri))
},
methods: {
resendInvitation() {
this.emailSent = true
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/components/program/DialogActivityCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export default {
copyActivitySourceUrlShowPopover: false,
entityProperties: ['title', 'location', 'scheduleEntries'],
embeddedEntities: ['category'],
entityUri: '/activities',
entityUri: '',
}
},
computed: {
Expand Down Expand Up @@ -247,6 +247,9 @@ export default {
)
},
},
mounted() {
this.api.href(this.api.get(), 'activities').then((url) => (this.entityUri = url))
},
methods: {
refreshCopyActivitySource() {
navigator.permissions.query({ name: 'clipboard-read' }).then(
Expand Down

0 comments on commit fa1f708

Please sign in to comment.