Skip to content

Commit

Permalink
fix(server): 🐛 return if documents are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan6erbond committed May 14, 2023
1 parent 841c7a5 commit 227cb16
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/pkg/meilisearch/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ func RegisterCommands(app *pocketbase.PocketBase, client *meilisearch.Client) {
postDocument, _ := getPostDocument(app, p)
documents = append(documents, postDocument)
}

if len(documents) == 0 {
return
}

_, err = client.Index("posts").AddDocuments(documents)

if err != nil {
Expand Down

0 comments on commit 227cb16

Please sign in to comment.