Skip to content

Commit 657a29d

Browse files
committed
feat: modify create so that history is always created
1 parent 259e462 commit 657a29d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/history-service/handlers/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ func (s *Service) CreateHistory(w http.ResponseWriter, r *http.Request) {
2222
}
2323

2424
// Document reference ID in firestore mapped to the match ID in model
25-
docRef := s.Client.Collection("collaboration-history").Doc(collaborationHistory.HistoryDocRefID)
25+
collection := s.Client.Collection("collaboration-history")
2626

27-
_, err := docRef.Set(ctx, map[string]interface{}{
27+
docRef, _, err := collection.Add(ctx, map[string]interface{}{
2828
"title": collaborationHistory.Title,
2929
"code": collaborationHistory.Code,
3030
"language": collaborationHistory.Language,

0 commit comments

Comments
 (0)