Skip to content

Commit

Permalink
feat(transfer): throw error in case of missing team template (#5009)
Browse files Browse the repository at this point in the history
* feat(transfer) Error on missing team template

* Update transfer_row.lua

* Apply suggestions from code review

linter

---------

Co-authored-by: hjpalpha <[email protected]>
  • Loading branch information
mbergen and hjpalpha authored Nov 7, 2024
1 parent 8d2130e commit 082bc3a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/transfer/commons/transfer_row.lua
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ function TransferRow:_readBaseData()
local toTeam = Array.map({args.team2 or '', args.team2_2 or ''}, FnUtil.curry(checkTeam, date))
local fromTeam = Array.map({args.team1 or '', args.team1_2 or ''}, FnUtil.curry(checkTeam, fromDate))

if Logic.isDeepEmpty(fromTeam) and String.isNotEmpty(args.team1) then
error('Missing team template for team ' .. args.team1)
end
if Logic.isDeepEmpty(toTeam) and String.isNotEmpty(args.team2) then
error('Missing team template for team ' .. args.team2)
end
---@param str string?
---@return string?
local ucFirst = function(str)
Expand Down

0 comments on commit 082bc3a

Please sign in to comment.