mirror of https://github.com/fantasticit/think.git
server: check organization
This commit is contained in:
parent
5f49205306
commit
9fa0df1f2f
|
@ -139,12 +139,15 @@ export class OrganizationService {
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
public async getOrganizationDetail(user: IUser, id: IOrganization['id']) {
|
public async getOrganizationDetail(user: IUser, id: IOrganization['id']) {
|
||||||
|
const organization = await this.organizationRepo.findOne({ id });
|
||||||
|
if (!organization) {
|
||||||
|
throw new HttpException('组织不存在', HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
await this.authService.canView(user.id, {
|
await this.authService.canView(user.id, {
|
||||||
organizationId: id,
|
organizationId: id,
|
||||||
wikiId: null,
|
wikiId: null,
|
||||||
documentId: null,
|
documentId: null,
|
||||||
});
|
});
|
||||||
const organization = await this.organizationRepo.findOne({ id });
|
|
||||||
return organization;
|
return organization;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue