Closed nelsonic closed 1 year ago
This is the function:
def move_item_from_lista_to_listb(item_cid, lista_cid, listb_cid, person_id) do
# Remove from List A:
remove_item_from_list(item_cid, lista_cid, person_id)
# Add to List B:
add_item_to_list(item_cid, listb_cid, person_id)
end
Like I said above, it's simple. Because we already had the two precursor functions thanks to #422
But I'm now thinking that from an Interface perspective what we actually want to do is update the whole list.seq
from the client so that we preserve the sequence
of the items
... ๐ญ
Included in #165 :shipit: If we decide not to use it, easy to remove. ๐
To aid with _moving _an
item
from onelist
to another, we need a littlefunction
.Todo
item.cid
should be removed fromlista
and added tolistb
. ๐งชThankfully we already have two helper functions we can call for this:
https://github.com/dwyl/mvp/blob/15af0f1158b00bc059bd7b2fc9c118ae4313fcbf/lib/app/list.ex#L171-L176
and:
https://github.com/dwyl/mvp/blob/15af0f1158b00bc059bd7b2fc9c118ae4313fcbf/lib/app/list.ex#L189-L199
So this should be relatively straightforward. ๐ญ