|
|
@ -36,10 +36,10 @@ export default class ProjectUser { |
|
|
|
true |
|
|
|
true |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
await NocoCache.appendToList( |
|
|
|
// reset all user projects cache
|
|
|
|
|
|
|
|
await NocoCache.delAll( |
|
|
|
CacheScope.USER_PROJECT, |
|
|
|
CacheScope.USER_PROJECT, |
|
|
|
[projectUser.fk_user_id], |
|
|
|
`${projectUser.fk_user_id}:*` |
|
|
|
`${CacheScope.USER_PROJECT}:${projectUser.project_id}` |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return this.get(project_id, fk_user_id, ncMeta); |
|
|
|
return this.get(project_id, fk_user_id, ncMeta); |
|
|
@ -236,13 +236,10 @@ export default class ProjectUser { |
|
|
|
`${MetaTable.PROJECT_USERS}.project_id`, |
|
|
|
`${MetaTable.PROJECT_USERS}.project_id`, |
|
|
|
`${MetaTable.PROJECT}.id` |
|
|
|
`${MetaTable.PROJECT}.id` |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// if (!isSuperAdmin) {
|
|
|
|
|
|
|
|
this.andOn( |
|
|
|
this.andOn( |
|
|
|
`${MetaTable.PROJECT_USERS}.fk_user_id`, |
|
|
|
`${MetaTable.PROJECT_USERS}.fk_user_id`, |
|
|
|
ncMeta.knex.raw('?', [userId]) |
|
|
|
ncMeta.knex.raw('?', [userId]) |
|
|
|
); |
|
|
|
); |
|
|
|
// }
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
.where(function () { |
|
|
|
.where(function () { |
|
|
|
this.where(`${MetaTable.PROJECT}.deleted`, false).orWhereNull( |
|
|
|
this.where(`${MetaTable.PROJECT}.deleted`, false).orWhereNull( |
|
|
|