Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
settingLogDataService.sqlCreate = async function (loadingTimeLimit, questionTimeLimit, userId) {
const sql = `INSERT ${sqlService.adminSchema}.[settingsLog] (loadingTimeLimit, questionTimeLimit, user_id)
VALUES (@loadingTimeLimit, @questionTimeLimit, @userId)`
const params = [
{
name: 'loadingTimeLimit',
value: loadingTimeLimit,
type: TYPES.Decimal,
scale: 2,
precision: 5
},
{
name: 'questionTimeLimit',
value: questionTimeLimit,
type: TYPES.Decimal,
scale: 2,
precision: 5
},
{
name: 'userId',
value: userId,
type: TYPES.Int
}
]
return sqlService.modify(sql, params)
}
settingDataService.sqlUpdate = async (loadingTimeLimit, questionTimeLimit) => {
const sql = 'UPDATE [Settings] SET loadingTimeLimit=@loadingTimeLimit, questionTimeLimit=@questionTimeLimit, updatedAt=GETUTCDATE() WHERE id=1'
const params = [
{
name: 'loadingTimeLimit',
value: loadingTimeLimit,
type: TYPES.Decimal,
scale: 2,
precision: 5
},
{
name: 'questionTimeLimit',
value: questionTimeLimit,
type: TYPES.Decimal,
scale: 2,
precision: 5
}
]
return sqlService.modify(sql, params)
}
settingDataService.sqlUpdate = async (loadingTimeLimit, questionTimeLimit) => {
const sql = 'UPDATE [Settings] SET loadingTimeLimit=@loadingTimeLimit, questionTimeLimit=@questionTimeLimit, updatedAt=GETUTCDATE() WHERE id=1'
const params = [
{
name: 'loadingTimeLimit',
value: loadingTimeLimit,
type: TYPES.Decimal,
scale: 2,
precision: 5
},
{
name: 'questionTimeLimit',
value: questionTimeLimit,
type: TYPES.Decimal,
scale: 2,
precision: 5
}
]
return sqlService.modify(sql, params)
}
settingLogDataService.sqlCreate = async function (loadingTimeLimit, questionTimeLimit, userId) {
const sql = `INSERT ${sqlService.adminSchema}.[settingsLog] (loadingTimeLimit, questionTimeLimit, user_id)
VALUES (@loadingTimeLimit, @questionTimeLimit, @userId)`
const params = [
{
name: 'loadingTimeLimit',
value: loadingTimeLimit,
type: TYPES.Decimal,
scale: 2,
precision: 5
},
{
name: 'questionTimeLimit',
value: questionTimeLimit,
type: TYPES.Decimal,
scale: 2,
precision: 5
},
{
name: 'userId',
value: userId,
type: TYPES.Int
}
]