aboutsummaryrefslogtreecommitdiff
path: root/jb-ui/src/pages/Transfer.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'jb-ui/src/pages/Transfer.tsx')
-rw-r--r--jb-ui/src/pages/Transfer.tsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/jb-ui/src/pages/Transfer.tsx b/jb-ui/src/pages/Transfer.tsx
index bef40d4..4192eee 100644
--- a/jb-ui/src/pages/Transfer.tsx
+++ b/jb-ui/src/pages/Transfer.tsx
@@ -1,5 +1,6 @@
import { type FormEvent, useState } from "react";
import { useAppDispatch, useAppSelector } from "@/hooks";
+import { useGetMeQuery } from "@/models/authAPI";
import { Button } from "@/components/ui/button";
import max_lulu from "./max-and-lulu.jpg";
@@ -43,7 +44,7 @@ type RequestState = "idle" | "working" | "sent" | "failed";
const TransferSubmit = function ({ onSubmitSuccess }) {
const [email, setEmail] = useState("");
const [state, setState] = useState<RequestState>("idle");
- const bpuid = useAppSelector((state) => state.app.bpuid);
+ const { data: user, isLoading, isError } = useGetMeQuery();
const submit = async (event: FormEvent<HTMLFormElement>) => {
event.preventDefault();
@@ -56,7 +57,7 @@ const TransferSubmit = function ({ onSubmitSuccess }) {
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
email: email,
- amt_worker_id: bpuid,
+ amt_worker_id: user?.product_user_id,
}),
});
@@ -132,10 +133,10 @@ const TransferSubmit = function ({ onSubmitSuccess }) {
const Transfer = function () {
const assignment_id = useAppSelector((state) => state.app.assignment_id);
- const bpuid = useAppSelector((state) => state.app.bpuid);
+ const { data: user, isLoading, isError } = useGetMeQuery();
const [submitted, setSubmitted] = useState(false);
- if (!bpuid) {
+ if (!user?.product_user_id) {
return (
<p className="text-center text-2xl py-3 text-red-800 font-semibold">
No Worker ID found. Please access this page through the Amazon