in Ox.Request, allow for 409 Conflict

This commit is contained in:
rlx 2011-10-31 16:02:00 +00:00
parent 496da6aa77
commit 63b61f520b
2 changed files with 10 additions and 5 deletions

View file

@ -193,15 +193,20 @@ Ox.Request = function(options) {
};
}
}
if (data.status.code == 200 || data.status.code == 404) {
// we have to include 404 so we can
// test for the existence of things
if (
data.status.code == 200
|| data.status.code == 404
|| data.status.code == 409
) {
// we have to include not found and conflict
// so that handlers can handle these cases
cache[req] = {
data: data,
time: Ox.getTime()
};
callback(data);
} else if (data.status.code >= 400 && data.status.code < 500) {
} else if (data.status.code == 401 || data.status.code == 403) {
// unauthorized or forbidden
var $dialog = Ox.Dialog({
buttons: [
Ox.Button({

View file

@ -1377,7 +1377,7 @@ Ox.List = function(options, self) {
bValue = sort[b.id],
ret = 0
if (aValue < bValue) {
ret = operator == '+' ? -1 : 1
ret = operator == '+' ? -1 : 1;
} else if (aValue > bValue) {
ret = operator == '+' ? 1 : -1;
}