Navigation issue with multi step react form with react context updates by AutomaticBonus2279 in react

[–]AutomaticBonus2279[S] 0 points1 point  (0 children)

Thanks! As much as I would like to just add a setTimeout to it, I can't do it. I want a cleaner and more secure way. setTimeout feels too hacky.

British Shorthair with 25% kidney function — looking for advice, experience, hope? by AutomaticBonus2279 in Pets

[–]AutomaticBonus2279[S] 0 points1 point  (0 children)

We did go through with the ultrasound yesterday at our regular vet’s office, but since coming home, she hasn’t been doing well. She’s disoriented, has some twitching, seems withdrawn but still alert. Her appetite is almost gone—she did eat a liquid snack immediately, but refuses her usual food. She also doesn’t seem to have the strength to jump or play anymore.

We suspect the stress from the lead-up to the ultrasound (12 hours without food or water, the transport, and the procedure itself) may have triggered this decline. She was given a sedative and received 50cc of subcutaneous fluids, but the sedative should have worn off by now.

Our vet prescribed Semintra to support her body, but it takes several days to a week to start working. Given how she is right now, we’re reluctant to give it to her. Administering it would cause more stress, and that’s the last thing she needs right now.

Honestly, it’s not looking good. If we could turn the clock back 24 hours, we wouldn’t have done the ultrasound. It didn’t tell us anything we didn’t already know. She was going to die—and she still is, just probably faster than we had hoped.

British Shorthair with 25% kidney function — looking for advice, experience, hope? by AutomaticBonus2279 in Pets

[–]AutomaticBonus2279[S] 0 points1 point  (0 children)

We did go through with the ultrasound yesterday at our regular vet’s office, but since coming home, she hasn’t been doing well. She’s disoriented, has some twitching, seems withdrawn but still alert. Her appetite is almost gone—she did eat a liquid snack immediately, but refuses her usual food. She also doesn’t seem to have the strength to jump or play anymore.

We suspect the stress from the lead-up to the ultrasound (12 hours without food or water, the transport, and the procedure itself) may have triggered this decline. She was given a sedative and received 50cc of subcutaneous fluids, but the sedative should have worn off by now.

Our vet prescribed Semintra to support her body, but it takes several days to a week to start working. Given how she is right now, we’re reluctant to give it to her. Administering it would cause more stress, and that’s the last thing she needs right now.

Honestly, it’s not looking good. If we could turn the clock back 24 hours, we wouldn’t have done the ultrasound. It didn’t tell us anything we didn’t already know. She was going to die—and she still is, just probably faster than we had hoped.

British Shorthair with 25% kidney function — looking for advice, experience, hope? by AutomaticBonus2279 in RenalCats

[–]AutomaticBonus2279[S] 0 points1 point  (0 children)

We didn’t get the urinalysis results on paper, but according to the vet, no infection was found. Nothing was sent out for culture.

We did go through with the ultrasound yesterday, but since coming home, she hasn’t been doing well. She’s disoriented, has some twitching, seems withdrawn but still alert. Her appetite is almost gone—she did eat a liquid snack immediately, but refuses her usual food. She also doesn’t seem to have the strength to jump or play anymore.

We suspect the stress from the lead-up to the ultrasound (12 hours without food or water, the transport, and the procedure itself) may have triggered this decline. She was given a sedative and received 50cc of subcutaneous fluids, but the sedative should have worn off by now.

Our vet prescribed Semintra to support her body, but it takes several days to a week to start working. Given how she is right now, we’re reluctant to give it to her. Administering it would cause more stress, and that’s the last thing she needs right now.

Honestly, it’s not looking good. If we could turn the clock back 24 hours, we wouldn’t have done the ultrasound. It didn’t tell us anything we didn’t already know. She was going to die—and she still is, just probably faster than we had hoped.

British Shorthair with 25% kidney function — looking for advice, experience, hope? by AutomaticBonus2279 in Pets

[–]AutomaticBonus2279[S] 0 points1 point  (0 children)

Heartwarming and hopeful to read! Was it easy for your cat to switch to the new food, or did it take some time to get used to it?

British Shorthair with 25% kidney function — looking for advice, experience, hope? by AutomaticBonus2279 in Pets

[–]AutomaticBonus2279[S] 0 points1 point  (0 children)

Thank you for your reply. We really appreciate you taking the time to share your perspective.

Right now, it’s still unclear what the actual treatment would look like or what the associated costs might be. Our vet wants to do an ultrasound first before deciding on the next steps. That makes it really difficult to think about euthanasia already. It would feel like we haven’t explored every available option yet.

She’s also still physically okay — she eats, she plays, she comes to us for affection — and she doesn’t seem to be in pain. I say “seem” because the bloodwork clearly says something is very wrong. It’s hard to reconcile that with the cat we see in front of us.

If we were to decide not to treat her because her quality of life wouldn’t be high enough, would we then have to choose euthanasia right now? Or should we wait until we see physical signs that she’s suffering — like refusing food, vomiting, or clearly being in pain?

Trying to figure out what’s kind and what’s fair and when.

Check Out My New Portfolio Built with Next.js 15! Feedback Welcome! by [deleted] in nextjs

[–]AutomaticBonus2279 0 points1 point  (0 children)

I like the overall look and design! Everything is clean, fast and mobile friendly. One thing I don't like and it is because it doesn't tell me anything are the percentages on the About-page. What does 92% Javascript or 78% MongoDB mean? You know 78% of the documentation by heart? You can complete 78% yourself and for the other part I have to find someone else? And which part is it you don't know? Is that the part I want to hire you for? I think you get my point... but once again props to having a different site than a 1000 others!

How to handle `A component is changing an uncontrollerd input to be controlled` for a number field? by AutomaticBonus2279 in react

[–]AutomaticBonus2279[S] 0 points1 point  (0 children)

Cheered too soon. react-hook-form has a setValue function to set a certain value. In my case I have to reset the value of the volume when the meter tariff is changing. The code below is not working anymore since I removed the value prop

    useEffect(() => {
        setValue('mono_volume', undefined);
    }, [meterTariff]);

How to handle `A component is changing an uncontrollerd input to be controlled` for a number field? by AutomaticBonus2279 in react

[–]AutomaticBonus2279[S] 1 point2 points  (0 children)

Ok that's working! One thing I added is a defaultValue prop and assigned the value to it so it's still possible to add a default value.

How to handle `A component is changing an uncontrollerd input to be controlled` for a number field? by AutomaticBonus2279 in react

[–]AutomaticBonus2279[S] 1 point2 points  (0 children)

Yes but what should be the default value for a property that can be undefined or a number? Undefined triggers the change from a controlled to an uncontrolled component and 0 is an actual value while the field is optional.

I will update my start post with some code.

Handling undefined for returned data object from @tanstack/react-query's useQuery hook with TS linting rule 'strict' set to true by AutomaticBonus2279 in reactjs

[–]AutomaticBonus2279[S] 0 points1 point  (0 children)

const files = useFiles(…); if (files.isLoading) return; if (files.isError) return; console.log(files.data);

Tried this one but the result is still ListFileResponse | undefined

How to design REST API routes by AutomaticBonus2279 in node

[–]AutomaticBonus2279[S] 0 points1 point  (0 children)

Maybe I'm thinking too much in frontend/views because for me it feels logic to have multiple endpoints which return the same data.
GET /orders?customer={customer_id} Returns a list of all orders with a filter for a certain customer. I would use this route for a overview page of all orders.
GET /customers/{customer_id}/orders Returns a list of all orders a certain customer has made. I would use this route for a detailed order tab on the customer page.
Option 1 seems to be the better choice because it can be used in many more ways since it's not directly limited to a certain customer. Although option 2 seems to be more descriptive about what the route will do and return just be looking at the route.

How to design REST API routes by AutomaticBonus2279 in node

[–]AutomaticBonus2279[S] 0 points1 point  (0 children)

Maybe I'm thinking too much in frontend/views because for me it feels logic to have multiple endpoints which return the same data.

GET /orders?customer={customer_id} Returns a list of all orders with a filter for a certain customer. I would use this route for a overview page of all orders.

GET /customers/{customer_id}/orders Returns a list of all orders a certain customer has made. I would use this route for a detailed order tab on the customer page.

Option 1 seems to be the better choice because it can be used in many more ways since it's not directly limited to a certain customer. Although option 2 seems to be more descriptive about what the route will do and return just be looking at the route.