[napajanie modalov na BE]

This commit is contained in:
romankko2 committed 2023-01-26 21:11:53 +01:00
1 parent 26792a85a6
commit 4c8ee66cd6
34 files changed
+494 -396

No files matched your search

+11 -13
View File
@@ -94,15 +94,6 @@ export default {
}
},
async created() {
try {
const allEmployees = await this.$axios.get_auth_data('v1/employees')
this.allEmployees = this._enrichEmployeesByFullName(allEmployees)
} catch (error) {
this.$toast.error(error)
}
},
methods: {
async save() {
if (!(await this.v$.$validate()))
@@ -120,12 +111,19 @@ export default {
}
},
async create(id = null) {
async showModal(team = null) {
this.visible = true
this.team = null
if (id) {
await this._load()
try {
const allEmployees = await this.$axios.get_auth_data('v1/employees')
this.allEmployees = this._enrichEmployeesByFullName(allEmployees)
} catch (error) {
this.$toast.error(error)
}
if (team?.id) {
await this._load(team.id)
} else {
const team = {
name: '',
@@ -145,7 +143,7 @@ export default {
async _create() {
try {
await this.$axios.post_auth('v1/teams', this.team)
await this.$axios.post_auth(`v1/teams`, this.team)
} catch (error) {
this.$toast.error(error)
}