Create Room Tutorial - 13 | Next14 FullStack Hotel Booking App

Поделиться
HTML-код
  • Опубликовано: 22 окт 2024

Комментарии • 8

  • @abdalhfeez4079
    @abdalhfeez4079 9 месяцев назад

    Very nice job

  • @jannickpedersen4620
    @jannickpedersen4620 9 месяцев назад

    Looking forward to the next one :D

  • @safariambience4052
    @safariambience4052 8 месяцев назад

    I am enjoying the series, great stuff. Can you guide me on ways to handle multiple images in room form using uploadthing?

    • @ChaooCharles
      @ChaooCharles  8 месяцев назад

      You can just specify the number of images you want at the uploadthing api, then once you upload, upload thing will return an array of upload images which you can add to state and upload the links to database

    • @safariambience4052
      @safariambience4052 8 месяцев назад

      @@ChaooCharles my main concern was how to handle theuseffect function with shouldValidate, showDirty for array of images since react-hook-form gives an error indicating I upload images

    • @ChaooCharles
      @ChaooCharles  8 месяцев назад

      @safariambience4052 I think you will just follow what I did, but instead of storing image as just a string you can store them as an array of image links, you can loop over the images after getting a response and construct an array of image strings, then directly update the state with that array, when state change, you can use that change to call useEffect or update hook form value