From 66ca0408074515d5bab8d7df96a1d5b7ecb11402 Mon Sep 17 00:00:00 2001 From: Mathis Date: Mon, 7 Oct 2024 12:01:13 +0200 Subject: [PATCH] Refactor indentation and import statements. Aligned the indentation to use tabs consistently and updated import statements to use double quotes for consistency throughout the file. These changes improve code readability and maintain uniform style. --- apps/backend/src/app/groups/groups.service.ts | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/apps/backend/src/app/groups/groups.service.ts b/apps/backend/src/app/groups/groups.service.ts index b8565a6..1dd5655 100644 --- a/apps/backend/src/app/groups/groups.service.ts +++ b/apps/backend/src/app/groups/groups.service.ts @@ -1,29 +1,28 @@ -import { Injectable } from '@nestjs/common'; -import { DbService } from 'apps/backend/src/app/db/db.service'; -import { FilesGroupTable } from 'apps/backend/src/app/db/schema'; -import { ilike } from 'drizzle-orm'; - +import { Injectable } from "@nestjs/common"; +import { DbService } from "apps/backend/src/app/db/db.service"; +import { FilesGroupTable } from "apps/backend/src/app/db/schema"; +import { ilike } from "drizzle-orm"; @Injectable() export class GroupsService { - constructor(private readonly database: DbService) {} + constructor(private readonly database: DbService) {} - //TODO a method to fetch groups in the database by a specific search with limit, offset and a search field (can be blank) - async getGroupsByName(limit: number, offset: number, search: string) { - return await this.database.use() - .select() - .from(FilesGroupTable) - .where(ilike(FilesGroupTable.groupName, search)) - .limit(limit) - .offset(offset) - .prepare("getGroupsByName") - .execute(); - } + //TODO a method to fetch groups in the database by a specific search with limit, offset and a search field (can be blank) + async getGroupsByName(limit: number, offset: number, search: string) { + return await this.database + .use() + .select() + .from(FilesGroupTable) + .where(ilike(FilesGroupTable.groupName, search)) + .limit(limit) + .offset(offset) + .prepare("getGroupsByName") + .execute(); + } - //TODO The method to create a group + //TODO The method to create a group + //TODO a method to delete a group and place the associated file at a null group reference - //TODO a method to delete a group and place the associated file at a null group reference - - //TODO a method to get the files of a group in the database by a specific search with limit, offset and a search field (can be blank) + //TODO a method to get the files of a group in the database by a specific search with limit, offset and a search field (can be blank) }