Merge remote-tracking branch 'origin/la/work'

This commit is contained in:
Liam Fitzgerald 2021-02-12 11:01:52 +10:00
commit 850d78af56
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
4 changed files with 10 additions and 6 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))
::
@ -132,15 +131,17 @@
state(rolodex (~(del by rolodex) ship))
::
++ handle-edit
|= [=ship =edit-field:store]
|= [=ship =edit-field:store timestamp=@da]
|^
^- (quip card _state)
=/ old (~(got by rolodex) ship)
?: (lte timestamp last-updated.old)
[~ state]
=/ contact (edit-contact old edit-field)
?: =(old contact)
[~ state]
=. last-updated.contact now.bowl
:- (send-diff [%edit ship edit-field] =(ship our.bowl))
=. last-updated.contact timestamp
:- (send-diff [%edit ship edit-field timestamp] =(ship our.bowl))
state(rolodex (~(put by rolodex) ship contact))
::
++ edit-contact

View File

@ -42,6 +42,7 @@
%- pairs
:~ [%ship (ship ship.upd)]
[%edit-field (edit edit-field.upd)]
[%timestamp (time timestamp.upd)]
==
::
%allow
@ -140,6 +141,7 @@
%- ot
:~ [%ship (su ;~(pfix sig fed:ag))]
[%edit-field edit]
[%timestamp di]
==
::
++ beings

View File

@ -32,7 +32,7 @@
$% [%initial =rolodex is-public=?]
[%add =ship =contact]
[%remove =ship]
[%edit =ship =edit-field]
[%edit =ship =edit-field timestamp=@da]
[%allow =beings]
[%disallow =beings]
[%set-public public=?]

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()
},
});
}