Skip to content

Commit

Permalink
Merge branch 'devResponseController' of https://github.com/InseeFr/Ge…
Browse files Browse the repository at this point in the history
…nesis-API into devResponseController
  • Loading branch information
alicela committed Oct 28, 2024
2 parents 8f64fbb + b770bfa commit 28b5d7d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ jobs:
uses: advanced-security/maven-dependency-submission-action@49866fead7de0b0083b89f5f653f9620548ccddf

- name: Coveralls GitHub Action
uses: coverallsapp/[email protected].3
uses: coverallsapp/[email protected].4
with:
fail-on-error: false
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.4</version>
<version>3.3.5</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ public ResponseEntity<Object> saveResponsesFromXmlCampaignFolder(@RequestParam("
} catch (GenesisException e) {
return ResponseEntity.status(e.getStatus()).body(e.getMessage());
}
return ResponseEntity.ok("Data saved");
if (errors.isEmpty()){
return ResponseEntity.ok("Data saved");
}else{
return ResponseEntity.internalServerError().body(errors.getFirst().getMessage());
}
}

//SAVE ALL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import fr.insee.genesis.infrastructure.repository.ScheduleMongoDBRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
Expand All @@ -19,6 +20,7 @@
import java.util.List;

@Service
@Qualifier("scheduleMongoAdapter")
@Slf4j
public class ScheduleMongoAdapter implements SchedulePersistencePort {
private final ScheduleMongoDBRepository scheduleMongoDBRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import fr.insee.genesis.infrastructure.repository.SurveyUnitMongoDBRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

Expand All @@ -23,6 +24,7 @@

@Slf4j
@Service
@Qualifier("surveyUnitMongoAdapter")
public class SurveyUnitMongoAdapter implements SurveyUnitPersistencePort {

private SurveyUnitMongoDBRepository mongoRepository;
Expand Down

0 comments on commit 28b5d7d

Please sign in to comment.