[teams] napojenie requestov

This commit is contained in:
romankko2 committed 2023-01-31 15:49:39 +01:00
1 parent 96954845a1
commit 86bea63cdd
9 files changed
+32 -30

No files matched your search

@@ -423,7 +423,7 @@ export default {
async _load(masterTaskId) {
try {
this.masterTask = await this.$axios.get_auth_data(`v1/master-tasks/${masterTaskId}`)
this.masterTask = await this.$axios.get_auth_data(`v1/mastertasks/${masterTaskId}`)
} catch (error) {
this.$toast.error(error)
}
@@ -439,7 +439,7 @@ export default {
async _update() {
try {
await this.$axios.post_auth(`v1/master-tasks/${this.masterTask.id}`)
await this.$axios.post_auth(`v1/mastertasks/${this.masterTask.id}`)
} catch (error) {
this.$toast.error(error)
}
@@ -447,7 +447,7 @@ export default {
async deleteTask(masterTaskId) {
try {
await this.$axios.delete(`v1/master-tasks/${masterTaskId}`)
await this.$axios.delete(`v1/mastertasks/${masterTaskId}`)
this.close()
} catch (error) {
this.$toast.error(error)
@@ -475,7 +475,7 @@ export default {
async _update() {
try {
await this.$axios.post_auth(`v1/master-tasks/${this.task.id}`)
await this.$axios.post_auth(`v1/mastertasks/${this.task.id}`)
} catch (error) {
this.$toast.error(error)
}
@@ -18,7 +18,7 @@
<script>
export default {
emits: ['deleted'],
emits: ['update'],
data() {
return {
@@ -35,9 +35,9 @@ export default {
async deleteTeam() {
try {
await this.$axios.delete(`v1/teams/${this.team.id}`)
await this.$axios.delete_auth(`v1/teams/${this.team.id}`)
this.visible = false
this.$emit('deleted', this.team)
this.$emit('update', this.team)
} catch (error) {
this.$toast.error(error)
}
@@ -69,7 +69,7 @@ import errorUtils from '@/plugins/lib@auth/_utils/error.utils'
const atLeastOne = (value) => value.length
export default {
emits: ['close'],
emits: ['close', 'update'],
components: {
ZAutocomplete,
@@ -143,7 +143,8 @@ export default {
async _create() {
try {
await this.$axios.post_auth(`v1/teams`, this.team)
await this.$axios.post_auth('v1/teams', {data: this.team})
this.$emit('update', this.team)
} catch (error) {
this.$toast.error(error)
}
@@ -151,7 +152,8 @@ export default {
async _edit() {
try {
await this.$axios.post_auth(`v1/teams/${this.team.id}`, this.team)
await this.$axios.put_auth(`v1/teams/${this.team.id}`, {data: this.team})
this.$emit('update', this.team)
} catch (error) {
this.$toast.error(error)
}