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) }