Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit c059e0b

Browse files
committed
update: function service for recipient
1 parent 07e11da commit c059e0b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/features/recipients/recipientService.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ export const updateRecipient = async (
3838
return data as Recipient;
3939
};
4040

41-
export const findRecipientById = async (id: number): Promise<string | null> => {
41+
export const findRecipientById = async (
42+
id: number,
43+
): Promise<Recipient | null> => {
4244
const { data, error } = await supabase
4345
.from('recipients')
44-
.select('name')
46+
.select('*')
4547
.eq('id', id)
4648
.single();
4749

@@ -50,5 +52,5 @@ export const findRecipientById = async (id: number): Promise<string | null> => {
5052
return null;
5153
}
5254

53-
return data?.name || null;
55+
return data as Recipient;
5456
};

0 commit comments

Comments
 (0)