Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Cai authored and Kevin Cai committed Oct 11, 2023
1 parent 0c2e2a5 commit a1f26e3
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 27 deletions.
24 changes: 20 additions & 4 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
import Link from 'next/link';
import {testFetchUserData,testFetchUserByUUID, testAddUserAddress} from "../supabase/tests/user_test" ;
import {
testFetchUserData,
testFetchUserByUUID,
testAddUserAddress,
} from '../supabase/tests/user_test';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import {testFetchOrderByUUID, testFetchOrders, testGetOrderById, testToggleOrderProgress, testUpdateAllOrdersProgressToTrue} from "../supabase/tests/order_test" ;
import {testFetchProducts, testFetchProductByName} from "../supabase/tests/product_test" ;
import {testFetchPickupData, testFetchPickupTimesByUUID } from "../supabase/tests/pickup_test"
import {
testFetchOrderByUUID,
testFetchOrders,
testGetOrderById,
testToggleOrderProgress,
testUpdateAllOrdersProgressToTrue,
} from '../supabase/tests/order_test';
import {
testFetchProducts,
testFetchProductByName,
} from '../supabase/tests/product_test';
import {
testFetchPickupData,
testFetchPickupTimesByUUID,
} from '../supabase/tests/pickup_test';

export default function Checkout() {
testFetchUserData();
Expand Down
10 changes: 6 additions & 4 deletions src/supabase/order_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
import { Order } from '../schema/schema';

// Replace these with your Supabase project URL and API key
const supabaseUrl = 'https://raqpvvgsmwarxhaialcz.supabase.co'
const supabaseApiKey = process.env.SUPABASE_KEY
const supabaseUrl = 'https://raqpvvgsmwarxhaialcz.supabase.co';
const supabaseApiKey = process.env.SUPABASE_KEY;

// Initialize the Supabase client
const supabase = createClient(supabaseUrl, supabaseApiKey ?? '');
Expand Down Expand Up @@ -57,7 +57,7 @@ export async function fetchOrderByUUID(
}
}

export async function getOrdersByUserId(
export async function getOrdersByUserId(
userId: string,
): Promise<
PostgrestSingleResponse<Order[]> | { data: never[]; error: PostgrestError }
Expand Down Expand Up @@ -141,7 +141,9 @@ export async function toggleOrderProgress(
}
}

export async function updateAllOrdersProgressToTrue(): Promise<boolean | string> {
export async function updateAllOrdersProgressToTrue(): Promise<
boolean | string
> {
try {
// Update all orders to set "approved" to true
const { error: updateError } = await supabase
Expand Down
5 changes: 2 additions & 3 deletions src/supabase/pickup_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ import {
import { Schedule } from '../schema/schema';

// Replace these with your Supabase project URL and API key
const supabaseUrl = 'https://raqpvvgsmwarxhaialcz.supabase.co'
const supabaseApiKey = process.env.SUPABASE_KEY
const supabaseUrl = 'https://raqpvvgsmwarxhaialcz.supabase.co';
const supabaseApiKey = process.env.SUPABASE_KEY;

// Initialize the Supabase client
const supabase = createClient(supabaseUrl, supabaseApiKey ?? '');


export async function fetchPickupData(): Promise<
PostgrestSingleResponse<Schedule[]> | { data: never[]; error: PostgrestError }
> {
Expand Down
4 changes: 2 additions & 2 deletions src/supabase/product_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
import { Product } from '../schema/schema';

// Replace these with your Supabase project URL and API key
const supabaseUrl = 'https://raqpvvgsmwarxhaialcz.supabase.co'
const supabaseApiKey = process.env.SUPABASE_KEY
const supabaseUrl = 'https://raqpvvgsmwarxhaialcz.supabase.co';
const supabaseApiKey = process.env.SUPABASE_KEY;

// Initialize the Supabase client
const supabase = createClient(supabaseUrl, supabaseApiKey ?? '');
Expand Down
5 changes: 1 addition & 4 deletions src/supabase/tests/pickup_test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/* eslint-disable no-console */
//

import {
fetchPickupData,
fetchPickupTimesByUUID,
} from '../pickup_queries'; // Replace './your-module' with the actual path to your module
import { fetchPickupData, fetchPickupTimesByUUID } from '../pickup_queries'; // Replace './your-module' with the actual path to your module

// Test fetching data
export async function testFetchPickupData() {
Expand Down
5 changes: 1 addition & 4 deletions src/supabase/tests/product_test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
/* eslint-disable no-console */
//

import {
fetchProducts,
fetchProductByID,
} from '../product_queries'; // Replace './your-module' with the actual path to your module
import { fetchProducts, fetchProductByID } from '../product_queries'; // Replace './your-module' with the actual path to your module

// Test fetching all products
export async function testFetchProducts() {
Expand Down
7 changes: 3 additions & 4 deletions src/supabase/tests/user_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
//

import {
fetchUserData,
fetchUserByUUID,
addUserAddress
fetchUserData,
fetchUserByUUID,
addUserAddress,
} from '../user_queries';

export async function testFetchUserData() {
Expand Down Expand Up @@ -39,4 +39,3 @@ export async function testAddUserAddress() {
console.error('Test Add User Address Error:', error);
}
}

4 changes: 2 additions & 2 deletions src/supabase/user_queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
import { User } from '../schema/schema';

// Replace these with your Supabase project URL and API key
const supabaseUrl = 'https://raqpvvgsmwarxhaialcz.supabase.co'
const supabaseApiKey = process.env.SUPABASE_KEY
const supabaseUrl = 'https://raqpvvgsmwarxhaialcz.supabase.co';
const supabaseApiKey = process.env.SUPABASE_KEY;

// Initialize the Supabase client
const supabase = createClient(supabaseUrl, supabaseApiKey ?? '');
Expand Down

0 comments on commit a1f26e3

Please sign in to comment.