Redux, RTK-Query, Reselect with Lenz Weber-Tronic and Mark Erikson | TypeScript Showcase #6

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 พ.ย. 2024

ความคิดเห็น • 10

  • @phryneas
    @phryneas ปีที่แล้ว +7

    Unfortunately, my internet connection froze up quite a bit and the screen share got mangled - it gets better after a while. I believe it's still worthwhile to watch and you all will enjoy it! :)

    • @MichiganTypeScript
      @MichiganTypeScript  ปีที่แล้ว +1

      You both had such incredible stuff to share that even audio-only this was so worthwhile! We're really looking forward to doing more in the future with some of your other projects!

  • @OnlyJavascript
    @OnlyJavascript 11 หลายเดือนก่อน

    i am very new to programming. I got stuck in handling responses. lemme share the code here.

    • @OnlyJavascript
      @OnlyJavascript 11 หลายเดือนก่อน

      from express:
      const existingUser = await db.user.findUnique({ where: { email: email } });
      if (existingUser)
      return res
      .status(409)
      .send({ message: `User, ${username} already exists` });

    • @OnlyJavascript
      @OnlyJavascript 11 หลายเดือนก่อน

      how to extract this response and use it in my component?

    • @OnlyJavascript
      @OnlyJavascript 11 หลายเดือนก่อน

      const response = await addUser(formData);
      console.log(response);
      if ("data" in response) {
      toast({
      title: "Success",
      description: `${response.data?.message}`,
      });
      } else {
      toast({
      title: "Error",
      description: `${
      "error" in response
      ? response.error?.data?.message
      : "Something went wrong"
      }`,
      });
      }

    • @OnlyJavascript
      @OnlyJavascript 11 หลายเดือนก่อน

      Property 'data' does not exist on type 'FetchBaseQueryError | SerializedError'.
      Property 'data' does not exist on type 'SerializedError'.ts

    • @MichiganTypeScript
      @MichiganTypeScript  11 หลายเดือนก่อน +1

      it's a lot easier to have a conversation on discord: how about you bring this over there? (links are in the video description)