Skip to content

Commit

Permalink
fixed the query doubled file
Browse files Browse the repository at this point in the history
  • Loading branch information
philipye314 committed Oct 21, 2023
1 parent df2329c commit 2ebf1e7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useLocalSearchParams, useRouter } from 'expo-router';
import React, { useEffect, useState } from 'react';
import { Image, Text, TouchableOpacity, View } from 'react-native';
import { getCase, uploadCase } from '../../../../../supabase/queries/case';
import { uploadCase } from '../../../../../supabase/queries/cases';
import { CaseUid } from '../../../../../types/types';
import styles from './styles';

Expand Down
20 changes: 0 additions & 20 deletions src/supabase/queries/case.ts

This file was deleted.

11 changes: 11 additions & 0 deletions src/supabase/queries/cases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ export async function getCasesByIds(caseIds: CaseUid[]): Promise<Case[]> {
}
}

export const uploadCase = async (caseId: any) => {
const {
data: { user },
} = await supabase.auth.getUser();
const userId = user?.id;
const { error } = await supabase.from('status').insert({ caseId, userId });

console.log(error);
return { error };
};

/**
* Parse supabase case query and return Case object.
*
Expand Down

0 comments on commit 2ebf1e7

Please sign in to comment.