Skip to content

Commit ecb98cb

Browse files
LFXV2-123: Enhance committee service response and update logic
- Added a nil check for the UID in the convertPayloadToUpdateBase method to prevent potential panics. - Removed the logging of committee name in the GetBase method for improved privacy. - Updated the Indexer call in the UpdateSettings method to use the correct subject for committee settings. Generated with [GitHub Copilot](https://github.com/features/copilot) Signed-off-by: Mauricio Zanetti Salomao <mauriciozanetti86@gmail.com>
1 parent f4dbad3 commit ecb98cb

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

cmd/committee-api/service/committee_service_response.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (s *committeeServicesrvc) convertPayloadToSettings(p *committeeservice.Crea
8686
// convertPayloadToUpdateBase converts GOA UpdateCommitteeBasePayload to CommitteeBase domain model
8787
func (s *committeeServicesrvc) convertPayloadToUpdateBase(p *committeeservice.UpdateCommitteeBasePayload) *model.Committee {
8888
// Check for nil payload to avoid panic
89-
if p == nil {
89+
if p == nil || p.UID == nil {
9090
return &model.Committee{}
9191
}
9292

internal/service/committee_reader.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ func (rc *committeeReaderOrchestrator) GetBase(ctx context.Context, uid string)
5353

5454
slog.DebugContext(ctx, "committee base retrieved successfully",
5555
"committee_uid", uid,
56-
"committee_name", committeeBase.Name,
5756
"revision", revision,
5857
)
5958

internal/service/committee_writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ func (uc *committeeWriterOrchestrator) UpdateSettings(ctx context.Context, setti
727727

728728
messages := []func() error{
729729
func() error {
730-
return uc.committeePublisher.Indexer(ctx, constants.IndexCommitteeSubject, messageIndexer)
730+
return uc.committeePublisher.Indexer(ctx, constants.IndexCommitteeSettingsSubject, messageIndexer)
731731
},
732732
func() error {
733733
return uc.committeePublisher.Access(ctx, constants.UpdateAccessCommitteeSubject, accessControlMessage)

0 commit comments

Comments
 (0)