contact-store: set last-updated appropriately and send last-updated in JS

This commit is contained in:
Logan Allen 2021-02-11 18:47:36 -06:00
parent f0a86b2de3
commit 1ddf9f5b84
2 changed files with 3 additions and 3 deletions

View File

@ -117,7 +117,6 @@
!=(contact(last-updated *@da) u.old(last-updated *@da)) !=(contact(last-updated *@da) u.old(last-updated *@da))
== ==
[~ state] [~ state]
=. last-updated.contact now.bowl
:- (send-diff [%add ship contact] =(ship our.bowl)) :- (send-diff [%add ship contact] =(ship our.bowl))
state(rolodex (~(put by rolodex) ship contact)) state(rolodex (~(put by rolodex) ship contact))
:: ::
@ -141,7 +140,7 @@
=/ contact (edit-contact old edit-field) =/ contact (edit-contact old edit-field)
?: =(old contact) ?: =(old contact)
[~ state] [~ state]
=. last-updated.contact now.bowl =. last-updated.contact timestamp
:- (send-diff [%edit ship edit-field] =(ship our.bowl)) :- (send-diff [%edit ship edit-field] =(ship our.bowl))
state(rolodex (~(put by rolodex) ship contact)) state(rolodex (~(put by rolodex) ship contact))
:: ::

View File

@ -6,6 +6,7 @@ import { GroupPolicy, Resource } from '~/types/group-update';
export default class ContactsApi extends BaseApi<StoreState> { export default class ContactsApi extends BaseApi<StoreState> {
add(ship: Patp, contact: any) { add(ship: Patp, contact: any) {
contact['last-updated'] = Date.now();
return this.storeAction({ add: { ship, contact } }); return this.storeAction({ add: { ship, contact } });
} }
@ -25,11 +26,11 @@ export default class ContactsApi extends BaseApi<StoreState> {
{add-group: {ship, name}} {add-group: {ship, name}}
{remove-group: {ship, name}} {remove-group: {ship, name}}
*/ */
console.log(ship, editField);
return this.storeAction({ return this.storeAction({
edit: { edit: {
ship, ship,
'edit-field': editField, 'edit-field': editField,
timestamp: Date.now()
}, },
}); });
} }