diff --git a/apps/infoalloggi/src/schemas/public/PublicSchema.ts b/apps/infoalloggi/src/schemas/public/PublicSchema.ts index b2780a9..9661491 100644 --- a/apps/infoalloggi/src/schemas/public/PublicSchema.ts +++ b/apps/infoalloggi/src/schemas/public/PublicSchema.ts @@ -1,6 +1,7 @@ // @generated // This file is automatically generated by Kanel. Do not modify manually. +import type { default as ServizioInteressiTable } from './ServizioInteressi'; import type { default as FlagsTable } from './Flags'; import type { default as AnnunciTable } from './Annunci'; import type { default as UsersTable } from './Users'; @@ -22,11 +23,12 @@ import type { default as StorageindexTable } from './Storageindex'; import type { default as MessagesTable } from './Messages'; import type { default as UsersAnagraficaTable } from './UsersAnagrafica'; import type { default as BanlistTable } from './Banlist'; -import type { default as InterestsTable } from './Interests'; import type { default as BannersTable } from './Banners'; import type { default as ServizioTable } from './Servizio'; export default interface PublicSchema { + servizio_interessi: ServizioInteressiTable; + flags: FlagsTable; annunci: AnnunciTable; @@ -69,8 +71,6 @@ export default interface PublicSchema { banlist: BanlistTable; - interests: InterestsTable; - banners: BannersTable; servizio: ServizioTable; diff --git a/apps/infoalloggi/src/schemas/public/Interests.ts b/apps/infoalloggi/src/schemas/public/ServizioInteressi.ts similarity index 53% rename from apps/infoalloggi/src/schemas/public/Interests.ts rename to apps/infoalloggi/src/schemas/public/ServizioInteressi.ts index f8cb5de..6903b89 100644 --- a/apps/infoalloggi/src/schemas/public/Interests.ts +++ b/apps/infoalloggi/src/schemas/public/ServizioInteressi.ts @@ -5,15 +5,15 @@ import type { AnnunciId } from './Annunci'; import type { UsersId } from './Users'; import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely'; -/** Represents the table public.interests */ -export default interface InterestsTable { +/** Represents the table public.servizio_interessi */ +export default interface ServizioInteressiTable { annuncioId: ColumnType; userId: ColumnType; } -export type Interests = Selectable; +export type ServizioInteressi = Selectable; -export type NewInterests = Insertable; +export type NewServizioInteressi = Insertable; -export type InterestsUpdate = Updateable; +export type ServizioInteressiUpdate = Updateable; diff --git a/apps/infoalloggi/src/server/services/interests.service.ts b/apps/infoalloggi/src/server/services/interests.service.ts index 3f5f6dc..765eadf 100644 --- a/apps/infoalloggi/src/server/services/interests.service.ts +++ b/apps/infoalloggi/src/server/services/interests.service.ts @@ -12,7 +12,7 @@ export const AddIntrest = async ({ }) => { try { await db - .insertInto("interests") + .insertInto("servizio_interessi") .values({ annuncioId, userId, @@ -38,7 +38,7 @@ export const RemoveInterest = async ({ }) => { try { await db - .deleteFrom("interests") + .deleteFrom("servizio_interessi") .where("annuncioId", "=", annuncioId) .where("userId", "=", userId) .execute(); @@ -62,7 +62,7 @@ export const HasUserInterest = async ({ }) => { try { const interest = await db - .selectFrom("interests") + .selectFrom("servizio_interessi") .where("annuncioId", "=", annuncioId) .where("userId", "=", userId) .selectAll() @@ -82,7 +82,7 @@ export const GetUserInterests = async (userId: UsersId) => { try { return ( await db - .selectFrom("interests") + .selectFrom("servizio_interessi") .where("userId", "=", userId) .select("annuncioId") .execute()