Skip to content

Commit

Permalink
prod users
Browse files Browse the repository at this point in the history
  • Loading branch information
euanmillar committed Feb 13, 2024
1 parent e61367d commit 8e58a0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/data-seeding/employees/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@
*
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
*/
import { QA_ENV } from '@countryconfig/constants'
import { readCSVToJSON } from '@countryconfig/utils'
import { Request, ResponseToolkit } from '@hapi/hapi'

export async function usersHandler(_: Request, h: ResponseToolkit) {
const users: unknown[] = await readCSVToJSON(
'./src/data-seeding/employees/source/default-employees.csv'
process.env.NODE_ENV === 'production' && !QA_ENV
? './src/data-seeding/employees/source/prod-employees.csv'
: './src/data-seeding/employees/source/test-employees.csv'
)
return h.response(users)
}
2 changes: 2 additions & 0 deletions src/data-seeding/employees/source/prod-employees.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
primaryOfficeId,givenNames,familyName,systemRole,role,mobile,username,email,password
CRVS_OFFICE_JWMRGwDBXK,Euan,Millar,NATIONAL_SYSTEM_ADMIN,National System Admin,,e.millar,opencrvscountryconfig@gmail.com,test

0 comments on commit 8e58a0c

Please sign in to comment.