revert!: simplify create users by removing group option
This commit is contained in:
parent
77c21dd292
commit
b62dbe9038
|
@ -5,10 +5,7 @@ import { capitalize, log, sanitize, toLogin } from '../utils.ts'
|
|||
async function createUsers(
|
||||
redmine: Redmine,
|
||||
csv: CsvEntry[],
|
||||
groupName: string,
|
||||
) {
|
||||
const userIds: number[] = []
|
||||
|
||||
for (const { firstname, lastname, mail } of csv) {
|
||||
const login = toLogin(firstname, lastname)
|
||||
|
||||
|
@ -23,21 +20,9 @@ async function createUsers(
|
|||
})
|
||||
|
||||
log.info(`create user ${login}#${user.id}`)
|
||||
userIds.push(user.id)
|
||||
} catch (error) {
|
||||
log.error(`create user ${login}`)
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
log.info(`add to "${groupName}" users [${userIds.join(', ')}]`)
|
||||
await redmine.unstableGroups.create({
|
||||
name: 'entrepreneur-01-24',
|
||||
userIds,
|
||||
})
|
||||
} catch (error) {
|
||||
log.error(`add to "${groupName}" users [${userIds.join(', ')}]`)
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue