Add description when importing from inventaire
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
inventaireid: String,
|
inventaireid: String,
|
||||||
title: String,
|
title: String,
|
||||||
author: String,
|
author: String,
|
||||||
|
description: String,
|
||||||
rating: Number,
|
rating: Number,
|
||||||
read: Boolean,
|
read: Boolean,
|
||||||
wantread: Boolean,
|
wantread: Boolean,
|
||||||
@@ -51,6 +52,7 @@ function openBook() {
|
|||||||
<div class="media-content">
|
<div class="media-content">
|
||||||
<div class="is-size-4">{{title}}</div>
|
<div class="is-size-4">{{title}}</div>
|
||||||
<div class="is-size-5 is-italic">{{author}}</div>
|
<div class="is-size-5 is-italic">{{author}}</div>
|
||||||
|
<div class="has-text-text-65 is-size-6" v-if="props.description">{{description}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="column is-narrow">
|
<div class="column is-narrow">
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ type Book struct {
|
|||||||
ISBN string `json:"isbn"`
|
ISBN string `json:"isbn"`
|
||||||
InventaireID string `json:"inventaireid"`
|
InventaireID string `json:"inventaireid"`
|
||||||
OpenLibraryId string `json:"openlibraryid"`
|
OpenLibraryId string `json:"openlibraryid"`
|
||||||
|
SmallDescription string
|
||||||
Summary string `json:"summary"`
|
Summary string `json:"summary"`
|
||||||
Author Author
|
Author Author
|
||||||
AuthorID uint
|
AuthorID uint
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ type BookSearchGet struct {
|
|||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
Title string `json:"title" binding:"required,max=300"`
|
Title string `json:"title" binding:"required,max=300"`
|
||||||
Author string `json:"author" binding:"max=100"`
|
Author string `json:"author" binding:"max=100"`
|
||||||
|
Description string `json:"description"`
|
||||||
InventaireID string `json:"inventaireid"`
|
InventaireID string `json:"inventaireid"`
|
||||||
Rating int `json:"rating"`
|
Rating int `json:"rating"`
|
||||||
Read bool `json:"read"`
|
Read bool `json:"read"`
|
||||||
@@ -70,7 +71,7 @@ func fetchBookSearchQuery(db *gorm.DB, userId uint, searchterm string) *gorm.DB
|
|||||||
|
|
||||||
func fetchBookSearchQueryBuilder(db *gorm.DB, userId uint) *gorm.DB {
|
func fetchBookSearchQueryBuilder(db *gorm.DB, userId uint) *gorm.DB {
|
||||||
query := db.Model(&model.Book{})
|
query := db.Model(&model.Book{})
|
||||||
query = query.Select("books.id, books.title, authors.name as author, books.inventaire_id, user_books.rating, user_books.read, user_books.want_read, " + selectStaticFilesPath())
|
query = query.Select("books.id, books.title, authors.name as author, books.small_description as description, books.inventaire_id, user_books.rating, user_books.read, user_books.want_read, " + selectStaticFilesPath())
|
||||||
query = joinAuthors(query)
|
query = joinAuthors(query)
|
||||||
query = query.Joins("left join user_books on (user_books.book_id = books.id and user_books.user_id = ?)", userId)
|
query = query.Joins("left join user_books on (user_books.book_id = books.id and user_books.user_id = ?)", userId)
|
||||||
query = joinStaticFiles(query)
|
query = joinStaticFiles(query)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ func saveInventaireBookToDb(ac appcontext.AppContext, inventaireBook inventaire.
|
|||||||
}
|
}
|
||||||
book := model.Book{
|
book := model.Book{
|
||||||
Title: inventaireBook.Title,
|
Title: inventaireBook.Title,
|
||||||
Summary: inventaireBook.Description,
|
SmallDescription: inventaireBook.Description,
|
||||||
InventaireID: inventaireBook.ID,
|
InventaireID: inventaireBook.ID,
|
||||||
Author: *author,
|
Author: *author,
|
||||||
AddedBy: *user,
|
AddedBy: *user,
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ func InventaireBooksToBookSearchGet(inventairebooks []inventaire.InventaireSearc
|
|||||||
ID: 0,
|
ID: 0,
|
||||||
Title: b.Label,
|
Title: b.Label,
|
||||||
Author: "",
|
Author: "",
|
||||||
|
Description: b.Description,
|
||||||
InventaireID: b.ID,
|
InventaireID: b.ID,
|
||||||
Rating: 0,
|
Rating: 0,
|
||||||
Read: false,
|
Read: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user