feat(spot): addComment fix (null -> 0 for array_lenght method)
This commit is contained in:
parent
3828159a86
commit
f007cb56fd
1 changed files with 1 additions and 1 deletions
|
|
@ -287,7 +287,7 @@ func (s *spotsImpl) addComment(spotID uint64, newComment *Comment, user *auth.Us
|
|||
sql := `WITH updated AS (
|
||||
UPDATE spots
|
||||
SET comments = array_append(comments, $1), updated_at = $2
|
||||
WHERE spot_id = $3 AND tenant_id = $4 AND deleted_at IS NULL AND array_length(comments, 1) < $5
|
||||
WHERE spot_id = $3 AND tenant_id = $4 AND deleted_at IS NULL AND COALESCE(array_length(comments, 1), 0) < $5
|
||||
RETURNING *)
|
||||
SELECT COUNT(*) FROM updated`
|
||||
encodedComment := s.encodeComment(newComment)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue