refactor: event names (#19945)

This commit is contained in:
Jason Rasmussen 2025-07-15 13:41:19 -04:00 committed by GitHub
parent 351701c4d6
commit 920d7de349
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 171 additions and 168 deletions

View file

@ -21,7 +21,7 @@ export class StackService extends BaseService {
const stack = await this.stackRepository.create({ ownerId: auth.user.id }, dto.assetIds);
await this.eventRepository.emit('stack.create', { stackId: stack.id, userId: auth.user.id });
await this.eventRepository.emit('StackCreate', { stackId: stack.id, userId: auth.user.id });
return mapStack(stack, { auth });
}
@ -41,7 +41,7 @@ export class StackService extends BaseService {
const updatedStack = await this.stackRepository.update(id, { id, primaryAssetId: dto.primaryAssetId });
await this.eventRepository.emit('stack.update', { stackId: id, userId: auth.user.id });
await this.eventRepository.emit('StackUpdate', { stackId: id, userId: auth.user.id });
return mapStack(updatedStack, { auth });
}
@ -49,13 +49,13 @@ export class StackService extends BaseService {
async delete(auth: AuthDto, id: string): Promise<void> {
await this.requireAccess({ auth, permission: Permission.STACK_DELETE, ids: [id] });
await this.stackRepository.delete(id);
await this.eventRepository.emit('stack.delete', { stackId: id, userId: auth.user.id });
await this.eventRepository.emit('StackDelete', { stackId: id, userId: auth.user.id });
}
async deleteAll(auth: AuthDto, dto: BulkIdsDto): Promise<void> {
await this.requireAccess({ auth, permission: Permission.STACK_DELETE, ids: dto.ids });
await this.stackRepository.deleteAll(dto.ids);
await this.eventRepository.emit('stacks.delete', { stackIds: dto.ids, userId: auth.user.id });
await this.eventRepository.emit('StackDeleteAll', { stackIds: dto.ids, userId: auth.user.id });
}
private async findOrFail(id: string) {