Skip to content

Commit

Permalink
refactor: add more types
Browse files Browse the repository at this point in the history
  • Loading branch information
Pinx0 committed Nov 6, 2024
1 parent 2aa78d6 commit 16b78c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/service.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -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;
Expand Down Expand Up @@ -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,
Expand All @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/types/Requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down

0 comments on commit 16b78c7

Please sign in to comment.