Added team list model and service
All checks were successful
the build was successful

This commit is contained in:
konrad 2019-02-24 18:23:05 +01:00
parent c1363a01ee
commit 0077b5d745
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 46 additions and 2 deletions

View File

@ -90,7 +90,9 @@
import auth from '../../auth'
import message from '../../message'
import TeamNamespaceService from '../../services/teamNamespace'
import TeamNamespaceModel from "../../models/teamNamespace";
import TeamNamespaceModel from '../../models/teamNamespace'
import TeamListModel from '../../models/teamList'
import TeamListService from '../../services/teamList'
export default {
name: 'team',
@ -116,7 +118,8 @@
created() {
if (this.type === 'list') {
this.typeString = `list`
this.teamService = new TeamListService()
this.teamStuffModel = new TeamListModel({listID: this.id})
} else if (this.type === 'namespace') {
this.typeString = `namespace`
this.teamService = new TeamNamespaceService()

19
src/models/teamList.js Normal file
View File

@ -0,0 +1,19 @@
import AbstractModel from './abstractModel'
export default class TeamListModel extends AbstractModel {
constructor(data) {
super(data)
}
defaults() {
return {
id: 0,
listID: 0,
teamID: 0,
right: 0,
created: 0,
updated: 0
}
}
}

22
src/services/teamList.js Normal file
View File

@ -0,0 +1,22 @@
import AbstractService from './abstractService'
import TeamListModel from '../models/teamList'
import TeamModel from '../models/team'
export default class TeamListService extends AbstractService {
constructor() {
super({
create: '/lists/{listID}/teams',
getAll: '/lists/{listID}/teams',
update: '/lists/{listID}/teams/{teamID}',
delete: '/lists/{listID}/teams/{teamID}',
})
}
modelFactory(data) {
return new TeamListModel(data)
}
modelGetAllFactory(data) {
return new TeamModel(data)
}
}