diff --git a/package-lock.json b/package-lock.json index a28762e..0e4b80e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4457,6 +4457,12 @@ "whatwg-url": "^7.0.0" } }, + "date-fns": { + "version": "2.0.0-alpha.27", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.0.0-alpha.27.tgz", + "integrity": "sha512-cqfVLS+346P/Mpj2RpDrBv0P4p2zZhWWvfY5fuWrXNR/K38HaAGEkeOwb47hIpQP9Jr/TIxjZ2/sNMQwdXuGMg==", + "dev": true + }, "date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", diff --git a/package.json b/package.json index 39ac8ef..3077257 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "buildfile": "^1.2.22", "bulma": "^0.7.4", "cookie-parser": "^1.4.4", + "date-fns": "^2.0.0-alpha.27", "deep-object-diff": "^1.1.0", "history": "^4.9.0", "jest": "^24.5.0", diff --git a/packages/client/src/crud/CRUDReducer.ts b/packages/client/src/crud/CRUDReducer.ts index ca09f9a..e24429c 100644 --- a/packages/client/src/crud/CRUDReducer.ts +++ b/packages/client/src/crud/CRUDReducer.ts @@ -137,6 +137,7 @@ export class CRUDReducer< ...state, ids: [...state.ids, payload.id], byId: { + ...state.byId, [payload.id]: payload, }, status: { @@ -160,6 +161,7 @@ export class CRUDReducer< } handleRemove = (state: ICRUDState, payload: T): ICRUDState => { + // FIXME site does not get removed because payload looks different! return { ...state, ids: state.ids.filter(id => id !== payload.id), diff --git a/packages/common/src/without.ts b/packages/common/src/without.ts index e521bc6..da76768 100644 --- a/packages/common/src/without.ts +++ b/packages/common/src/without.ts @@ -3,7 +3,8 @@ export function without, K extends keyof R>( key: K, ): Pick> { return Object.keys(items).reduce((obj, k) => { - if (key === k) { + /* tslint:disable-next-line */ + if (key == k) { return obj } (obj as any)[k] = items[k]