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))
==
[~ state]
=. last-updated.contact now.bowl
:- (send-diff [%add ship contact] =(ship our.bowl))
state(rolodex (~(put by rolodex) ship contact))
::
@ -141,7 +140,7 @@
=/ contact (edit-contact old edit-field)
?: =(old contact)
[~ state]
=. last-updated.contact now.bowl
=. last-updated.contact timestamp
:- (send-diff [%edit ship edit-field] =(ship our.bowl))
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> {
add(ship: Patp, contact: any) {
contact['last-updated'] = Date.now();
return this.storeAction({ add: { ship, contact } });
}
@ -25,11 +26,11 @@ export default class ContactsApi extends BaseApi<StoreState> {
{add-group: {ship, name}}
{remove-group: {ship, name}}
*/
console.log(ship, editField);
return this.storeAction({
edit: {
ship,
'edit-field': editField,
timestamp: Date.now()
},
});
}