summaryrefslogtreecommitdiff
path: root/src/clients/loaders.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients/loaders.ts')
-rw-r--r--src/clients/loaders.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/clients/loaders.ts b/src/clients/loaders.ts
index 618e593..7e44f16 100644
--- a/src/clients/loaders.ts
+++ b/src/clients/loaders.ts
@@ -20,6 +20,17 @@ export async function addressLoader({ params }) {
return request;
}
+export async function cardLoader({ params }) {
+ const client = new ApiClient();
+ const path = `/account/cards/${ params.cardId }`;
+ const request = await client.authenticatedGet(path);
+
+ if(request.response)
+ return redirect("/account");
+
+ return request;
+}
+
export async function accountLoader() {
const client = new ApiClient();