Skip to content

Commit

Permalink
Merge pull request #64 from Grupo13-PES-Mascotas/hotfix/v2.0.1
Browse files Browse the repository at this point in the history
Hotfix/v2.0.1
  • Loading branch information
marclll authored May 25, 2020
2 parents 4b7f761 + eb6a1d1 commit 4ee3167
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ jobs:
with:
java-version: 1.8

- name: Decrypt release secret
- name: Decrypt secrets
run: |
chmod +x ./.github/scripts/decrypt_key.sh
chmod +x ./.github/scripts/decrypt_develop_key.sh
./.github/scripts/decrypt_key.sh
./.github/scripts/decrypt_develop_key.sh
env:
FIREBASE_DEVELOP_PASSPHRASE: ${{ secrets.FIREBASE_DEVELOP_PASSPHRASE }}
FIREBASE_PASSPHRASE: ${{ secrets.FIREBASE_PASSPHRASE }}

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ out/

my-pet-care-85883-firebase-adminsdk-voovm-0b4dfbf318.json
my-pet-care-production-firebase-adminsdk-c1es4-6387c47d60.json
/src/main/resources/application.properties
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Software project from FIB (Facultat d'Informàtica de Barcelona)

## Documentation
Documentation for the current release:
- [Webservice Javadoc](https://javadoc.jitpack.io/com/github/Grupo13-PES-Mascotas/PES_My-Pet-Care-Webservice/develop-5330235bba-1/javadoc/)
- [Webservice Javadoc](https://javadoc.jitpack.io/com/github/Grupo13-PES-Mascotas/PES_My-Pet-Care-Webservice/v2.0.1/javadoc/)
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ public void updateEvent(@RequestHeader(TOKEN) String accessToken, @PathVariable
*/
@DeleteMapping("/event/{owner}/{petName}")
public void deleteEvent(@RequestHeader(TOKEN) String accessToken, @PathVariable String owner,
@PathVariable String petName, @RequestBody Map<String, Object> body)
@PathVariable String petName, @RequestBody Map<String, String> body)
throws CalendarAccessException, DatabaseAccessException, DocumentException {
googleCalendarService.deleteEvent(accessToken, owner, petName, (String) body.get("eventId"));
googleCalendarService.deleteEvent(accessToken, owner, petName, body.get("eventId"));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static void checkCollectionKeyAndBody(String field, String key, Map<Strin
checkMeals(key, body);
break;
case WEIGHTS:
checkDateAndValueInteger(key, body);
checkDateAndValueDouble(key, body);
break;
case EXERCISES:
checkExercises(key, body);
Expand Down Expand Up @@ -181,16 +181,16 @@ public static void checkMeals(String key, Map<String, Object> body) {

/**
* Checks that key and body have the correct format for a date key and body with one element whose key is 'value'
* and has an Object of type Integer.
* and has an Object of type Double.
* @param key Key of the attribute
* @param body Body of the attribute
*/
public static void checkDateAndValueInteger(String key, Map<String, Object> body) {
public static void checkDateAndValueDouble(String key, Map<String, Object> body) {
checkDateFormat(key);
if (body.size() != 1 || !body.containsKey(VALUE)) {
throw new IllegalArgumentException(INCORRECT_BODY_FORMAT);
}
if (!(body.get(VALUE) instanceof Integer)) {
if (!(body.get(VALUE) instanceof Integer) && !(body.get(VALUE) instanceof Double)) {
throw new IllegalArgumentException(INCORRECT_BODY_FORMAT);
}
}
Expand Down

0 comments on commit 4ee3167

Please sign in to comment.