Add workshops CMS API with schedule, registrations, and public storefront routes.
Includes SQL migrations, Prisma models, dashboard CRUD, registration status workflow, and website OpenAPI updates for workshop listing and signup. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
9d56ec7396
commit
c7d5204b49
@@ -117,7 +117,7 @@ export class BlogsService {
|
||||
}
|
||||
|
||||
const authorId = dto.authorId ? BigInt(dto.authorId) : actor.id;
|
||||
await this.assertAuthorBelongsToBusiness(businessId, authorId);
|
||||
await this.assertAuthorBelongsToBusiness(businessId, authorId, actor);
|
||||
|
||||
if (dto.categoryId) {
|
||||
await this.assertCategoryBelongsToBusiness(businessId, BigInt(dto.categoryId));
|
||||
@@ -202,7 +202,7 @@ export class BlogsService {
|
||||
authorId = null;
|
||||
} else {
|
||||
authorId = BigInt(dto.authorId);
|
||||
await this.assertAuthorBelongsToBusiness(businessId, authorId);
|
||||
await this.assertAuthorBelongsToBusiness(businessId, authorId, actor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -679,7 +679,15 @@ export class BlogsService {
|
||||
}
|
||||
}
|
||||
|
||||
private async assertAuthorBelongsToBusiness(businessId: bigint, authorId: bigint) {
|
||||
private async assertAuthorBelongsToBusiness(
|
||||
businessId: bigint,
|
||||
authorId: bigint,
|
||||
actor: AuthUser,
|
||||
) {
|
||||
if (await this.permissions.isSuperAdmin(actor.id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const member = await this.prisma.businessUser.findFirst({
|
||||
where: { businessId, userId: authorId },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user