Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
Fix updated settings bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ndegwamartin committed Oct 15, 2018
1 parent 790d2e6 commit 127fa07
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions assets/server_defaults/anc/site_characteristics.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
"locationId": "",
"providerId": "",
"teamId": "",
"dateCreated": "",
"dateCreated": "1970-10-04T10:17:09.993+03:00",
"serverVersion": 1,
"settings": [
{
"key": "site_ipv_assess",
"label": "Minimum requirements for IPV assessment",
"value": null,
"description": "\"Are all of the following in place at your facility: \r\n1. A protocol or standard operating procedure for Intimate Partner Violence (IPV); \r\n2. A health worker trained on how to ask about IPV and how to provide the minimum response or beyond;\r\n3. A private setting; \r\n4. A way to ensure confidentiality; \r\n5. Time to allow for appropriate disclosure; and\r\n6. A system for referral in place. \""
"description": "Are all of the following in place at your facility: \r\n\ta. A protocol or standard operating procedure for Intimate Partner Violence (IPV); \r\n\tb. A health worker trained on how to ask about IPV and how to provide the minimum response or beyond;\r\n\tc. A private setting; \r\n\td. A way to ensure confidentiality; \r\n\te. Time to allow for appropriate disclosure; and\r\n\tf. A system for referral in place. "
},
{
"key": "site_anc_hiv",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public interface SettingRepository extends BaseRepository<SettingConfiguration>

SettingsMetadata saveSetting(SettingConfiguration settingConfiguration, SettingsMetadata settingMetadata);

SettingsMetadata getSettingMetadataByIdentifier(String identifier);
SettingsMetadata getSettingMetadataByIdentifierAndTeamId(String identifier, String teamId);

Settings getSettingById(Long id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public List<SettingConfiguration> findAllLatestSettingsByVersion(Long lastSynced
}

@Override
public SettingsMetadata getSettingMetadataByIdentifier(String identifier) {
public SettingsMetadata getSettingMetadataByIdentifierAndTeamId(String identifier, String teamId) {
// TODO Auto-generated method stub
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ public void add(SettingConfiguration entity) {
}

@Override
public SettingsMetadata getSettingMetadataByIdentifier(String identifier) {
public SettingsMetadata getSettingMetadataByIdentifierAndTeamId(String identifier, String teamId) {
SettingsMetadataExample example = new SettingsMetadataExample();
example.createCriteria().andIdentifierEqualTo(identifier);
example.createCriteria().andIdentifierEqualTo(identifier).andTeamIdEqualTo(teamId);

List<SettingsMetadata> settingsMetadata = settingMetadataMapper.selectByExample(example);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public synchronized SettingsMetadata saveSetting(String jsonSettingConfiguration
SettingConfiguration settingConfigurations = gson.fromJson(jsonSettingConfiguration,
new TypeToken<SettingConfiguration>() {}.getType());

SettingsMetadata metadata = settingRepository.getSettingMetadataByIdentifier(settingConfigurations.getIdentifier());
SettingsMetadata metadata = settingRepository.getSettingMetadataByIdentifierAndTeamId(settingConfigurations.getIdentifier(), settingConfigurations.getTeamId());
Settings settings;

if (metadata != null) {
Expand Down

0 comments on commit 127fa07

Please sign in to comment.