Implement getAllFilesTypes in files controller
Added return statement to getTypes endpoint in files controller, utilizing the newly updated getAllFilesTypes method from the files service. Also fixed minor formatting issues.
This commit is contained in:
parent
6bb9510356
commit
877e13043d
@ -136,14 +136,14 @@ export class FilesController {
|
||||
@HttpCode(HttpStatus.FOUND)
|
||||
@Get("types")
|
||||
async getTypes() {
|
||||
//TODO
|
||||
return await this.filesService.getAllFilesTypes();
|
||||
}
|
||||
|
||||
@HttpCode(HttpStatus.CREATED)
|
||||
@UseGuards(AdminGuard)
|
||||
@Post("types/new")
|
||||
async newType(@Body() body: CreateFileTypeDto) {
|
||||
return await this.filesService.createFileType(body.name, body.mime)
|
||||
return await this.filesService.createFileType(body.name, body.mime);
|
||||
}
|
||||
|
||||
@HttpCode(HttpStatus.ACCEPTED)
|
||||
|
@ -285,12 +285,13 @@ export class FilesService {
|
||||
*
|
||||
* @return {Promise<Array>} Promise that resolves to an array of file types.
|
||||
*/
|
||||
public async getAllFilesTypes() {
|
||||
return await this.database.use()
|
||||
public async getAllFilesTypes(): Promise<Array<object>> {
|
||||
return await this.database
|
||||
.use()
|
||||
.select()
|
||||
.from(FilesTypesTable)
|
||||
.prepare("getAllFilesTypes")
|
||||
.execute()
|
||||
.execute();
|
||||
}
|
||||
|
||||
public async removeFileType() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user