fixed hierarchy error

This commit is contained in:
Tangent 2019-06-27 20:09:07 -07:00
parent 386cfee85a
commit 3e37a90153
2 changed files with 8 additions and 8 deletions

View File

@ -21,8 +21,8 @@ class extends lapis.Application
return redirect_to: @url_for "tracks"
POST: =>
if track = update_track(@params)
-- return redirect_to: @url_for "track", id: track.id
return redirect_to: @url_for "track", id: @params.id
return redirect_to: @url_for "track", id: track.id
-- return redirect_to: @url_for "track", id: @params.id
else
return redirect_to: @url_for "tracks"
}

View File

@ -18,7 +18,7 @@ update_track = (user_input) ->
updates = {}
-- automatic tags
for field in *{"artist", "mood", "link", "genre"}
if user_input[field] and #user_input[field] > 0 -- NOTE includes fix
if user_input[field] and #user_input[field] > 0
if user_input.tags
user_input.tags ..= " #{field}:#{user_input[field]\gsub "%s+", "_"}"
else