MCPcopy Index your code
hub / github.com/whoiskatrin/chart-gpt / decreaseUserCredits

Function decreaseUserCredits

utils/helper.ts:17–27  ·  view source on GitHub ↗
(row_id: any)

Source from the content-addressed store, hash-verified

15}
16
17export async function decreaseUserCredits(row_id: any) {
18 const { data, error } = await supabase.rpc('decrease_credits', {
19 row_id,
20 });
21
22 if (error) {
23 throw new Error('Error updating user credits');
24 }
25
26 return data;
27}
28
29export async function addUserCredits(row_id: any, credit_amount: any) {
30 const { data, error } = await supabase.rpc('add_credits', {

Callers 1

handlerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected