Skip to content

Commit

Permalink
Merge 0a358a4 into f44109d
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmahidalgo committed Jul 12, 2022
2 parents f44109d + 0a358a4 commit 9418b3d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Collection/Collection.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ export class Collection extends Model<CollectionAttributes> {
: SQL`
WHERE (
(items.blockchain_item_id is NOT NULL AND c.third_party_id IS NULL)
OR c.third_party_id is NOT NULL))
OR c.third_party_id is NOT NULL
)
`
}
`
Expand Down Expand Up @@ -291,7 +292,10 @@ export class Collection extends Model<CollectionAttributes> {
)})
VALUES (${database.toValuePlaceholders(collection)})
ON CONFLICT (id)
DO UPDATE SET ${database.toAssignmentFields(attributes, 1)},"updated_at" = now()
DO UPDATE SET ${database.toAssignmentFields(
attributes,
1
)},"updated_at" = now()
RETURNING *, (SELECT COUNT(*) FROM ${
Item.tableName
} WHERE collections.id = items.collection_id) as item_count`,
Expand Down

0 comments on commit 9418b3d

Please sign in to comment.