Skip to content

Commit

Permalink
ARSN-178: better isValid for AmzRestore class
Browse files Browse the repository at this point in the history
  • Loading branch information
williamlardier committed May 3, 2022
1 parent 0afddfa commit 642ef25
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/models/ObjectMDAmzRestore.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ class ObjectMDAmzRestore {
*/
static isValid(data) {
try {
const restoreMD = new ObjectMDAmzRestore(false);
restoreMD.setOngoingRequest(data['ongoing-request']);
restoreMD.setExpiryDate(data['expiry-date']);
return true;
const object = new ObjectMDAmzRestore(data['ongoing-request'], data['expiry-date']);
return !!object;
} catch (err) {
return false;
}
Expand Down

0 comments on commit 642ef25

Please sign in to comment.