Skip to content

Commit

Permalink
Fix uncommitted changes (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
starcraft66 authored Aug 3, 2024
1 parent dd73844 commit 00246ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/lanpartyseating/logic/station_logic.ex
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,18 @@ defmodule Lanpartyseating.StationLogic do
def save_station_positions(table) do
Repo.delete_all(Station)

now_naive =
NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)

positions =
table
|> Enum.flat_map(fn row ->
row
|> Enum.map(fn station_number ->
%Station{station_number: station_number, display_order: station_number}
%{station_number: station_number, display_order: station_number, inserted_at: now_naive, updated_at: now_naive}
end)
end)
|> IO.inspect

Repo.insert_all(Station, positions)
:ok
Expand Down

0 comments on commit 00246ed

Please sign in to comment.