-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
T25mTime Estimate 25 MinutesTime Estimate 25 MinutesdiscussShare your constructive thoughts on how to make progress with this issueShare your constructive thoughts on how to make progress with this issueelixirPull requests that update Elixir codePull requests that update Elixir codeenhancementNew feature or enhancement of existing functionalityNew feature or enhancement of existing functionalityhelp wantedIf you can help make progress with this issue, please comment!If you can help make progress with this issue, please comment!priority-2Second highest priority, should be worked on as soon as the Priority-1 issues are finishedSecond highest priority, should be worked on as soon as the Priority-1 issues are finishedtechnicalA technical issue that requires understanding of the code, infrastructure or dependenciesA technical issue that requires understanding of the code, infrastructure or dependencies
Description
To aid with _moving _an item
from one list
to another, we need a little function
.
Todo
- Create the tests:
item.cid
should be removed fromlista
and added tolistb
. π§ͺ - Write the function. π§βπ»
- Ship!!
Note: this only applies if the
list
is not"All"
which we should not removeitems
from;
That's the whole point of the"All"
list
...
Thankfully we already have two helper functions we can call for this:
Lines 171 to 176 in 15af0f1
def add_item_to_list(item_cid, list_cid, person_id) do | |
list = get_list_by_cid!(list_cid) | |
prev_seq = get_list_seq(list) | |
seq = [item_cid | prev_seq] |> Enum.join(",") | |
update_list(list, %{seq: seq, person_id: person_id}) | |
end |
and:
Lines 189 to 199 in 15af0f1
def remove_item_from_list(item_cid, list_cid, person_id) do | |
list = get_list_by_cid!(list_cid) | |
# get existing list.seq | |
seq = | |
get_list_seq(list) | |
# remove the item_cid from the list.seq: | |
|> Useful.remove_item_from_list(item_cid) | |
|> Enum.join(",") | |
update_list(list, %{seq: seq, person_id: person_id}) | |
end |
So this should be relatively straightforward. π
Metadata
Metadata
Assignees
Labels
T25mTime Estimate 25 MinutesTime Estimate 25 MinutesdiscussShare your constructive thoughts on how to make progress with this issueShare your constructive thoughts on how to make progress with this issueelixirPull requests that update Elixir codePull requests that update Elixir codeenhancementNew feature or enhancement of existing functionalityNew feature or enhancement of existing functionalityhelp wantedIf you can help make progress with this issue, please comment!If you can help make progress with this issue, please comment!priority-2Second highest priority, should be worked on as soon as the Priority-1 issues are finishedSecond highest priority, should be worked on as soon as the Priority-1 issues are finishedtechnicalA technical issue that requires understanding of the code, infrastructure or dependenciesA technical issue that requires understanding of the code, infrastructure or dependencies
Type
Projects
Status
β
Done
Status
Done