This repository has been archived by the owner on May 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Event resource with workaround to cfpio/callForPapers#103
- Loading branch information
Jean-Louis Jouannic
committed
Jan 2, 2017
1 parent
49d5a58
commit 1bb0294
Showing
5 changed files
with
36 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
export const Event = (RestangularProvider) => { | ||
'ngInject' | ||
|
||
const applicationPath = 'application' | ||
|
||
const parseDate = (stringDate) => moment(stringDate, 'DD/MM/YYYY', true) | ||
|
||
RestangularProvider.addResponseInterceptor((data, operation, what) => { // temporary workaround to… | ||
if (what === applicationPath && operation === 'get') { //… https://github.com/cfpio/callForPapers/issues/103 | ||
['date', 'decisionDate', 'releaseDate'].forEach((prop) => { | ||
data[prop] = parseDate(data[prop]) | ||
}) | ||
} | ||
return data | ||
}) | ||
|
||
return { | ||
'$get': (Restangular) => { | ||
'ngInject' | ||
|
||
return Restangular.one(applicationPath) // "application" resource not really RESTful… | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters