Revert "nuova veste grafica: myskills, mygoods, mybachecas, myhosps,"
This reverts commit 6fad472211.
This commit is contained in:
@@ -35,7 +35,7 @@ import { Router } from 'vue-router'
|
||||
import { useProjectStore } from '@store/Projects'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { costanti } from '@costanti'
|
||||
import { IBookmark, IFavBook, IFavorite, IGroupShort, IMyGroup, IUserAdmins } from '@model/UserStore'
|
||||
import { IBookmark, IGroupShort, IMyGroup, IUserAdmins } from '@model/UserStore'
|
||||
|
||||
import globalroutines from '../globalroutines/index'
|
||||
import { useNotifStore } from '@store/NotifStore'
|
||||
@@ -83,8 +83,6 @@ export const DefaultUser: IUserFields = {
|
||||
notifs: [],
|
||||
bookmark: [],
|
||||
favorite: [],
|
||||
myfav: [],
|
||||
mybook: [],
|
||||
notif_idCities: [],
|
||||
notif_provinces: [],
|
||||
notif_regions: [],
|
||||
@@ -152,8 +150,6 @@ export const DefaultProfile: IUserProfile = {
|
||||
notifs: [],
|
||||
bookmark: [],
|
||||
favorite: [],
|
||||
myfav: [],
|
||||
mybook: [],
|
||||
notif_idCities: [],
|
||||
notif_provinces: [],
|
||||
notif_regions: [],
|
||||
@@ -1478,7 +1474,6 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
return Api.SendReq('/myskills/page', 'POST', data)
|
||||
.then((res) => {
|
||||
console.log('res.data', res)
|
||||
return res.data
|
||||
}).catch((error) => {
|
||||
return {}
|
||||
@@ -1497,7 +1492,6 @@ export const useUserStore = defineStore('UserStore', {
|
||||
.then((res) => {
|
||||
return res.data
|
||||
}).catch((error) => {
|
||||
console.error('err', error)
|
||||
return {}
|
||||
})
|
||||
|
||||
@@ -1646,28 +1640,19 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
},
|
||||
|
||||
async setFavorite($q: any, t: any, id: any, table: string, myrec: any) {
|
||||
let value = false
|
||||
async setFavorite($q: any, t: any, id: any, table: string) {
|
||||
let value = {}
|
||||
|
||||
console.log('table', table)
|
||||
const tab = tools.getNumTabByTable(table)
|
||||
|
||||
value = this.isFavorite(id, table) ? false : true
|
||||
|
||||
return await Api.SendReq('/users/cmd', 'POST', { cmd: CMD_USER.SET_FAVORITE, id, tab, value })
|
||||
.then((res) => {
|
||||
if (res && res.data.state === 1) {
|
||||
if (!myrec.myfav)
|
||||
myrec.myfav = []
|
||||
this.my.profile.favorite.push({ id, tab })
|
||||
if (myrec)
|
||||
myrec.myfav.push({ username: this.my.username })
|
||||
tools.showPositiveNotif($q, t('cmd.favorite_set'))
|
||||
} else if (res && res.data.state === -1) {
|
||||
this.my.profile.favorite = tools.removeIObjectOnce(this.my.profile.favorite, { id, tab })
|
||||
if (myrec && myrec.myfav)
|
||||
myrec.myfav = myrec.myfav.filter((rec: IFavBook) => rec.username !== this.my.username)
|
||||
tools.showPositiveNotif($q, t('cmd.favorite_unset'))
|
||||
this.my.profile.favorite = tools.removeItemOnce(this.my.profile.favorite, { id, tab })
|
||||
tools.showPositiveNotif($q, t('db.favorite_unset'))
|
||||
}
|
||||
}).catch((error) => {
|
||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||
@@ -1684,34 +1669,23 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
isFavorite(id: string, table: string) {
|
||||
const tab = tools.getNumTabByTable(table)
|
||||
const myfavorite = this.my.profile.favorite.find((rec: IFavorite) => ((rec.id === id) && (rec.tab === tab)))
|
||||
const myfavorite = this.my.profile.favorite.find((rec: IBookmark) => ((rec.id === id) && (rec.tab === tab)))
|
||||
return myfavorite
|
||||
},
|
||||
|
||||
async setBookmark($q: any, t: any, id: any, table: string, myrec: any) {
|
||||
let value = false
|
||||
async setBookmark($q: any, t: any, id: any, table: string) {
|
||||
let value = {}
|
||||
|
||||
const tab = tools.getNumTabByTable(table)
|
||||
|
||||
value = this.isBookmarked(id, table) ? false : true
|
||||
|
||||
return await Api.SendReq('/users/cmd', 'POST', { cmd: CMD_USER.SET_BOOKMARK, id, tab, value })
|
||||
.then((res) => {
|
||||
if (res && res.data.state === 1) {
|
||||
if (!myrec.mybook)
|
||||
myrec.mybook = []
|
||||
this.my.profile.bookmark.push({ id, tab })
|
||||
if (myrec)
|
||||
myrec.mybook.push({ username: this.my.username })
|
||||
tools.showPositiveNotif($q, t('cmd.bookmark_set'))
|
||||
} else if (res && res.data.state === -1) {
|
||||
this.my.profile.bookmark = tools.removeIObjectOnce(this.my.profile.bookmark, { id, tab })
|
||||
if (myrec && myrec.mybook)
|
||||
myrec.mybook = myrec.mybook.filter((rec: IFavBook) => rec.username !== this.my.username)
|
||||
tools.showPositiveNotif($q, t('cmd.bookmark_unset'))
|
||||
tools.showPositiveNotif($q, t('db.bookmark_unset'))
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('error', error)
|
||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||
return {}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user