forked from 0x2620/pandora
pass empty result to updateAnnotation to handle invalid entity input
This commit is contained in:
parent
ad8db3a293
commit
ef3a7b720f
1 changed files with 10 additions and 8 deletions
|
@ -149,14 +149,16 @@ pandora.ui.editor = function(data) {
|
||||||
Ox.Log('', 'editAnnotation', data);
|
Ox.Log('', 'editAnnotation', data);
|
||||||
function callback(result) {
|
function callback(result) {
|
||||||
Ox.Log('', 'editAnnotation result', result);
|
Ox.Log('', 'editAnnotation result', result);
|
||||||
result.data.date = Ox.formatDate(
|
if (!Ox.isEmpty(result.data)) {
|
||||||
result.data.modified.slice(0, 10), '%B %e, %Y'
|
result.data.date = Ox.formatDate(
|
||||||
);
|
result.data.modified.slice(0, 10), '%B %e, %Y'
|
||||||
result.data.languages = (
|
);
|
||||||
result.data.languages || [pandora.site.language]
|
result.data.languages = (
|
||||||
).map(function(language) {
|
result.data.languages || [pandora.site.language]
|
||||||
return Ox.getLanguageNameByCode(language);
|
).map(function(language) {
|
||||||
});
|
return Ox.getLanguageNameByCode(language);
|
||||||
|
});
|
||||||
|
}
|
||||||
that.updateAnnotation(data.id, result.data);
|
that.updateAnnotation(data.id, result.data);
|
||||||
Ox.Request.clearCache();
|
Ox.Request.clearCache();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue