Skip to content

Commit

Permalink
throw error when trying to transform manually with code IDs but found…
Browse files Browse the repository at this point in the history
… none in config
  • Loading branch information
NoahSaso committed Jun 2, 2024
1 parent 9fa25d4 commit 9892e27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/scripts/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ const main = async () => {
const codeIds = (
codeIdsKeys && typeof codeIdsKeys === 'string' ? codeIdsKeys.split(',') : []
).flatMap((key) => config.codeIds?.[key] ?? [])
if (typeof codeIdsKeys === 'string' && codeIds.length === 0) {
throw new Error('No code IDs found in config')
}

const includeContract = {
include: {
model: Contract,
Expand Down

0 comments on commit 9892e27

Please sign in to comment.