##// END OF EJS Templates
Added tag v1.0.0 for changeset 7110eac54b19
Added tag v1.0.0 for changeset 7110eac54b19

File last commit:

r0:7110eac54b19 v1.0.0 default
r1:8b476fada8c1 default
Show More
ContentNegotiateModule.js
21 lines | 841 B | application/javascript | JavascriptLexer
/ src / main / js / ContentNegotiateModule.js
define(["dojo/_base/declare", "dojo/when", "./BaseResponse", "./ModelResponse"],function(declare,when, BaseResponse, ModelResponse) {
return declare(null,{
invoke: function(httpRequest, next) {
return when(next(), function(result) {
if (!(result instanceof BaseResponse) ){
result = new ModelResponse(result);
}
if (!(result instanceof ModelResponse))
return result;
result.presenter = {
present: JSON.stringify,
contentType: "application/json; charset=utf-8"
};
// TODO select presenter and assing it to result.presenter
return result;
});
}
});
});