fix(views): make bucket creation work again
This commit is contained in:
parent
4c1a53beed
commit
445f1c06fa
@ -6,10 +6,10 @@ import type { IBucket } from '@/modelTypes/IBucket'
|
||||
export default class BucketService extends AbstractService<IBucket> {
|
||||
constructor() {
|
||||
super({
|
||||
getAll: '/projects/{projectId}/buckets',
|
||||
create: '/projects/{projectId}/buckets',
|
||||
update: '/projects/{projectId}/buckets/{id}',
|
||||
delete: '/projects/{projectId}/buckets/{id}',
|
||||
getAll: '/projects/{projectId}/views/{projectViewId}/buckets',
|
||||
create: '/projects/{projectId}/views/{projectViewId}/buckets',
|
||||
update: '/projects/{projectId}/views/{projectViewId}/buckets/{id}',
|
||||
delete: '/projects/{projectId}/views/{projectViewId}/buckets/{id}',
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -576,6 +576,7 @@ async function createNewBucket() {
|
||||
await kanbanStore.createBucket(new BucketModel({
|
||||
title: newBucketTitle.value,
|
||||
projectId: project.value.id,
|
||||
projectViewId: viewId,
|
||||
}))
|
||||
newBucketTitle.value = ''
|
||||
}
|
||||
@ -595,6 +596,7 @@ async function deleteBucket() {
|
||||
bucket: new BucketModel({
|
||||
id: bucketToDelete.value,
|
||||
projectId: project.value.id,
|
||||
projectViewId: viewId,
|
||||
}),
|
||||
params: params.value,
|
||||
})
|
||||
|
@ -23,7 +23,10 @@ import (
|
||||
|
||||
// CanCreate checks if a user can create a new bucket
|
||||
func (b *Bucket) CanCreate(s *xorm.Session, a web.Auth) (bool, error) {
|
||||
pv := &ProjectView{ID: b.ProjectViewID}
|
||||
pv := &ProjectView{
|
||||
ID: b.ProjectViewID,
|
||||
ProjectID: b.ProjectID,
|
||||
}
|
||||
return pv.CanUpdate(s, a)
|
||||
}
|
||||
|
||||
@ -43,6 +46,9 @@ func (b *Bucket) canDoBucket(s *xorm.Session, a web.Auth) (bool, error) {
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
pv := &ProjectView{ID: bb.ProjectViewID}
|
||||
pv := &ProjectView{
|
||||
ID: bb.ProjectViewID,
|
||||
ProjectID: bb.ProjectID,
|
||||
}
|
||||
return pv.CanUpdate(s, a)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user