Categories
Mastering Development

Why can’t insert data in the review table?

The error mentions that a violation of foreign key constraints. MY ERROR: sqlalchemy.exc.IntegrityError: (psycopg2.errors.ForeignKeyViolation) insert or update on table “reviews” violates foreign key constraint “reviews_book_id_fkey” DETAIL: Key (book_id)=(770) is not present in table “reviews”. MY QUERY: db.execute(“INSERT INTO reviews (comment, score, user_id, book_id) VALUES (:comment, :score, :user_id, :book_id)”, {“comment”:comment, “score”: score, “user_id”: user.id, “book_id”: book_id}) […]

Categories
Mastering Development

‘v-for’ with ‘v-if’ vuejs/laravel

I have two tables one is books and another one is stock and I am trying to get the books by their name and show it in the stock table I have tried the below code but it shows me this error. [vue/no-use-v-if-with-v-for] The ‘Books’ variable inside ‘v-for’ directive should be replaced with a computed […]

Categories
Mastering Development

‘v-for’ with ‘v-if’ vuejs/laravel

I have two tables one is books and another one is stock and I am trying to get the books by their name and show it in the stock table I have tried the below code but it shows me this error. [vue/no-use-v-if-with-v-for] The ‘Books’ variable inside ‘v-for’ directive should be replaced with a computed […]