diff --git a/src/lib/service.ts b/src/lib/service.ts index 69876452..f551a2db 100644 --- a/src/lib/service.ts +++ b/src/lib/service.ts @@ -1,5 +1,5 @@ import { supabase } from './supabase/client'; -import { HelpRequestAssignmentInsert, HelpRequestData } from '@/types/Requests'; +import { HelpRequestAssignmentInsert, HelpRequestData, HelpRequestUpdate } from '@/types/Requests'; import { createClient } from '@/lib/supabase/server'; export const helpRequestService = { @@ -9,7 +9,7 @@ export const helpRequestService = { if (error) throw error; return data[0]; }, - async editRequest(requestData: any, id: any) { + async editRequest(requestData: HelpRequestUpdate, id: number) { const { data, error } = await supabase.from('help_requests').update(requestData).eq('id', id).select(); if (error) throw error; return data; @@ -199,7 +199,7 @@ export const authService = { async getSessionUser() { return supabase.auth.getUser(); }, - async signUp(email: any, password: any, nombre: any, telefono: any) { + async signUp(email: string, password: string, nombre: string, telefono: string) { return supabase.auth.signUp({ email, password, @@ -214,7 +214,7 @@ export const authService = { async signOut() { return supabase.auth.signOut(); }, - async signIn(email: any, password: any) { + async signIn(email: string, password: string) { return supabase.auth.signInWithPassword({ email, password }); }, async updateUser(metadata: any) { diff --git a/src/types/Requests.ts b/src/types/Requests.ts index be7daf9e..c875a3af 100644 --- a/src/types/Requests.ts +++ b/src/types/Requests.ts @@ -4,6 +4,7 @@ export type HelpRequestType = 'necesita' | 'ofrece'; export type HelpRequestUrgencyType = 'alta' | 'media' | 'baja'; export type HelpRequestStatusType = 'pending' | 'in_progress' | 'active'; export type HelpRequestData = Database['public']['Tables']['help_requests']['Row']; +export type HelpRequestUpdate = Database['public']['Tables']['help_requests']['Update']; export type HelpRequestAssignmentData = Database['public']['Tables']['help_request_assignments']['Row']; export type HelpRequestAssignmentInsert = Database['public']['Tables']['help_request_assignments']['Insert'];