Basic Likes and Follows - Database and API set up

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

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

  • @TaiwoMegbope
    @TaiwoMegbope 2 года назад +3

    @xano you guys have built an incredibly powerful tool. Don't worry about low traction yet, there's no way this doesn't scale. Well done.

  • @trojanofficial5380
    @trojanofficial5380 2 года назад +4

    For anyone wondering about like/unlike, you can add like/unlike under same endpoint. Just make a if condition after getting the record. If it returns null then create a new record, if a record is found the delete that record. Hitting that endpoint will work like clicking like button and clicking again for removing the like. Sort of a toggle button.

    • @logiflix3337
      @logiflix3337 2 года назад

      Hi,
      Awesome Stuff. The unlike action picks the first record it finds based on the input parameter (user id or listing id) in the table while the user could be un-liking a different listing down the table. Am i missing something or is there a way to go around that.

    • @logiflix3337
      @logiflix3337 2 года назад

      For instance if Michael likes 5 different items it will delete the first item Mike likes in table which may not be the case. If you filter by items it will deletes the first item it finds in the table, which is even worse cause it could be another user 's like

    • @TaiwoMegbope
      @TaiwoMegbope 2 года назад

      @@logiflix3337 I guess including a product id in the products table should solve that. For every like or unlike, the API should have a product id number that it will check and only if it exists (or does not exist) should it add or remove it from the product table.

  • @philliprousu652
    @philliprousu652 2 года назад

    Awesome