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.
This commit is contained in:
Mathis H (Avnyr) 2024-10-15 13:49:45 +02:00
parent a5f54e165b
commit 6bb9510356
Signed by: Mathis
GPG Key ID: DD9E0666A747D126

View File

@ -280,8 +280,17 @@ export class FilesService {
}
}
/**
* Retrieves all file types from the database.
*
* @return {Promise<Array>} 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() {