Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .forgeai-screenshots/console-2026-03-28T04-42-48-311Z.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ 16963ms] [ERROR] Error: supabaseUrl is required.
at new SupabaseClient (webpack-internal:///(app-pages-browser)/./node_modules/@supabase/supabase-js/dist/module/SupabaseClient.js:66:19)
at createClient (webpack-internal:///(app-pages-browser)/./node_modules/@supabase/supabase-js/dist/module/index.js:48:12)
at Object.getAllCredit [as queryFn] (webpack-internal:///(app-pages-browser)/./src/app/services/getAllCredit.ts:23:89)
at Object.fetchFn [as fn] (webpack-internal:///(app-pages-browser)/./node_modules/@tanstack/query-core/build/lib/query.mjs:261:27)
at run (webpack-internal:///(app-pages-browser)/./node_modules/@tanstack/query-core/build/lib/retryer.mjs:111:31)
at eval (webpack-internal:///(app-pages-browser)/./node_modules/@tanstack/query-core/build/lib/retryer.mjs:151:11) @ webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-index.js:31
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 18 additions & 3 deletions src/app/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ const Modal: React.FC<ModalProps> = ({onClose, children}) => {

const queryClient = useQueryClient()
const onSubmit = (data: any) => {
addCard({...data, type_credit_card: 'VISA'})
addCard(data)
setModalOpen(false)
queryClient.invalidateQueries(["getCards"])

}


Expand All @@ -29,7 +29,7 @@ const Modal: React.FC<ModalProps> = ({onClose, children}) => {
className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-70 z-50"
>
<div
className="rounded-b-2xl bg-white h-64 w-96"
className="rounded-b-2xl bg-white w-96"
onClick={e => e.stopPropagation()}
>
<form onSubmit={handleSubmit(onSubmit)} className="bg-white p-6 rounded-lg shadow-lg w-96 flex flex-wrap">
Expand Down Expand Up @@ -60,6 +60,21 @@ const Modal: React.FC<ModalProps> = ({onClose, children}) => {
</div>
</div>
<div className="w-1/2 pl-2">
<div className="mb-4">
<label className="block text-sm font-semibold mb-2" htmlFor="type_credit_card">Card Type</label>
<select
{...register("type_credit_card", {required: true})}
className="w-full px-3 py-2 text-sm leading-tight text-gray-700 border rounded shadow appearance-none focus:outline-none focus:shadow-outline"
id="type_credit_card"
defaultValue=""
>
<option value="" disabled>Select type</option>
<option value="VISA">VISA</option>
<option value="MASTERCARD">MasterCard</option>
<option value="AMEX">AmEx</option>
</select>
{errors.type_credit_card && <span className="text-red-500 text-xs">This field is required</span>}
</div>
<div className="mb-4">
<label className="block text-sm font-semibold mb-2" htmlFor="expiration">Expiration</label>
<input
Expand Down