mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[napajanie modalov na BE]
This commit is contained in:
1 parent
26792a85a6
commit
4c8ee66cd6
34 files changed
+494
-396
No files matched your search
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user