From 6bb95103560fa545031b6836210ce88e295b95be Mon Sep 17 00:00:00 2001 From: Mathis Date: Tue, 15 Oct 2024 13:49:45 +0200 Subject: [PATCH] Add retrieval method for all file types in files service Implemented the `getAllFilesTypes` method to retrieve all file types from the database. This method uses the database connection to select and return an array of file types, completing the previously marked TODO item. --- apps/backend/src/app/files/files.service.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/backend/src/app/files/files.service.ts b/apps/backend/src/app/files/files.service.ts index d3920cb..e3378cd 100644 --- a/apps/backend/src/app/files/files.service.ts +++ b/apps/backend/src/app/files/files.service.ts @@ -280,8 +280,17 @@ export class FilesService { } } + /** + * Retrieves all file types from the database. + * + * @return {Promise} Promise that resolves to an array of file types. + */ public async getAllFilesTypes() { - //TODO + return await this.database.use() + .select() + .from(FilesTypesTable) + .prepare("getAllFilesTypes") + .execute() } public async removeFileType() {