Return related data (User_id)
hi i have a working piece of code.. however i'm not sure how to return the username (in another table) when i have the user_id
useEffect(() => {
if (!delayedStart) return () => null;
const subscription = supabase
.from("bids")
.on("INSERT", (payload) => {
// if (init) {
console.log("message send recieved", payload);
console.log(
"Value of old messages:",
bids,
"Value of new message:",
payload.new
);
setBids((b) => [...b, payload.new]);
setDelayedStart(false);
setTimeout(() => {
setDelayedStart(true);
}, 420);
// }
})
.subscribe((state) => {
console.log("DEBUG: subscribe", state);
});
return () => {
supabase.removeSubscription(subscription);
};
}, [delayedStart]);useEffect(() => {
if (!delayedStart) return () => null;
const subscription = supabase
.from("bids")
.on("INSERT", (payload) => {
// if (init) {
console.log("message send recieved", payload);
console.log(
"Value of old messages:",
bids,
"Value of new message:",
payload.new
);
setBids((b) => [...b, payload.new]);
setDelayedStart(false);
setTimeout(() => {
setDelayedStart(true);
}, 420);
// }
})
.subscribe((state) => {
console.log("DEBUG: subscribe", state);
});
return () => {
supabase.removeSubscription(subscription);
};
}, [delayedStart]);amount: "12"
case_id: 1
created_at: "2022-09-08T13:24:48.99641+00:00"
id: 46
user_id: "b9d966fd-f47f-4b96-9025-55053ac6c290amount: "12"
case_id: 1
created_at: "2022-09-08T13:24:48.99641+00:00"
id: 46
user_id: "b9d966fd-f47f-4b96-9025-55053ac6c290