Skip to content

Commit

Permalink
refactor: responses for GET MailAccounts consider updated rest-api-email
Browse files Browse the repository at this point in the history
  • Loading branch information
ThorstenSuckow committed Jun 11, 2022
1 parent 11c9640 commit 68644a3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/model/mail/account/MailAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ Ext.define("conjoon.cn_mail.model.mail.account.MailAccount", {
}, {
name: "outbox_secure",
type: "string"
}],
}].map(field => {
if (!["id", "type"].includes(field.name)) {
field.mapping = `attributes.${field.name}`;
}
return field;
}),

/**
* Overriden to make sure we can specify class statics for values of
Expand Down
12 changes: 11 additions & 1 deletion tests/src/model/mail/account/MailAccountTest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* conjoon
* extjs-app-webmail
* Copyright (C) 2017-2021 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-webmail
* Copyright (C) 2017-2022 Thorsten Suckow-Homberg https://github.com/conjoon/extjs-app-webmail
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -91,4 +91,14 @@ StartTest(t => {
});


t.it("test mappings php-lib-conjoon#8", t => {

model.fields.forEach(field => {
if (field.getName() !== "id" && Object.prototype.hasOwnProperty.call(field, "definedBy")) {
t.expect(field.getMapping()).toBe(`attributes.${field.getName()}`);
}
});

});

});

0 comments on commit 68644a3

Please sign in to comment.