зеркало из https://github.com/microsoft/paris.git
Undo buggy bug fix + bump version (#53)
* Undo buggy bug fix + bump version * Fix tests Co-authored-by: Nitsan Amit <nitsanamit@microsoft.com>
This commit is contained in:
Родитель
ada6a3dc47
Коммит
5ce0581b21
|
@ -46,6 +46,9 @@ export class Modeler {
|
|||
entityIdProperty = typeof(entityIdProperty) === "string" ? entityIdProperty.toLowerCase() : entityIdProperty;
|
||||
}
|
||||
|
||||
if (entity instanceof ModelEntity)
|
||||
modelData.id = rawData[entityIdProperty];
|
||||
|
||||
let getModelDataError:Error = new Error(`Failed to create ${entity.singularName}.`);
|
||||
|
||||
if (typeof entity.modelWith === 'function') {
|
||||
|
@ -106,9 +109,6 @@ export class Modeler {
|
|||
}
|
||||
});
|
||||
|
||||
if (entity instanceof ModelEntity)
|
||||
modelData.id = rawData[entityIdProperty];
|
||||
|
||||
let model$:Observable<TEntity>;
|
||||
|
||||
if (subModels.length) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@microsoft/paris",
|
||||
"version": "1.11.0",
|
||||
"version": "1.11.1",
|
||||
"description": "Library for the implementation of Domain Driven Design with TypeScript + RxJS",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -8,8 +8,7 @@ import {CommentStatus} from "./comment-status.entity";
|
|||
@Entity({
|
||||
singularName: 'Comment',
|
||||
pluralName: 'Comments',
|
||||
endpoint: 'comments',
|
||||
idProperty: 'commentID',
|
||||
endpoint: 'comments'
|
||||
})
|
||||
export class Comment extends EntityModelBase {
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ describe('Modeler', () => {
|
|||
|
||||
describe('ignoreFieldsCasing', () => {
|
||||
const commentRawData = {
|
||||
CommentId: 'comment1',
|
||||
id: 'comment1',
|
||||
COMMENT: 'Hello world!',
|
||||
StatuS: 2,
|
||||
createdBy: {
|
||||
|
@ -217,7 +217,7 @@ describe('Modeler', () => {
|
|||
|
||||
it('ignores casing of simple entity fields', done => {
|
||||
commentItem$.subscribe((comment: Comment) => {
|
||||
expect(comment.id).toEqual(commentRawData.CommentId);
|
||||
expect(comment.id).toEqual(commentRawData.id);
|
||||
expect(comment.comment).toEqual(commentRawData.COMMENT);
|
||||
expect(comment.status).toEqual(commentStatusValues[commentRawData.StatuS]);
|
||||
done();
|
||||
|
|
Загрузка…
Ссылка в новой задаче