feat: delete space and edit space slug (#307)

* feat: make space slug editable

* feat: delete space

* client
This commit is contained in:
Philip Okugbe
2024-09-16 17:43:40 +01:00
committed by GitHub
parent dea9f4c063
commit fb27282886
18 changed files with 435 additions and 111 deletions

View File

@ -40,6 +40,21 @@ export class AttachmentRepo {
.executeTakeFirst();
}
async findBySpaceId(
spaceId: string,
opts?: {
trx?: KyselyTransaction;
},
): Promise<Attachment[]> {
const db = dbOrTx(this.db, opts?.trx);
return db
.selectFrom('attachments')
.selectAll()
.where('spaceId', '=', spaceId)
.execute();
}
async updateAttachment(
updatableAttachment: UpdatableAttachment,
attachmentId: string,
@ -52,7 +67,7 @@ export class AttachmentRepo {
.executeTakeFirst();
}
async deleteAttachment(attachmentId: string): Promise<void> {
async deleteAttachmentById(attachmentId: string): Promise<void> {
await this.db
.deleteFrom('attachments')
.where('id', '=', attachmentId)