@@ -10,9 +10,7 @@ import { run as runUpdater } from '../updater'
10
10
import InfoText from '../db/models/infotext'
11
11
import { statsViewerIams } from '../util/config'
12
12
import { generateTerms } from '../util/util'
13
- import { Where } from 'sequelize/types/utils'
14
13
import { ApplicationError } from '../util/ApplicationError'
15
- import { ValidModelName } from '../../config'
16
14
17
15
const adminRouter = express . Router ( )
18
16
@@ -31,14 +29,13 @@ adminRouter.use((req, _, next) => {
31
29
interface NewChatInstanceData {
32
30
name : string
33
31
description : string
34
- model : ValidModelName
35
32
usageLimit : number
36
33
courseId : string
37
34
}
38
35
39
36
adminRouter . post ( '/chatinstances' , async ( req , res ) => {
40
37
const data = req . body as NewChatInstanceData
41
- const { name, description, model , usageLimit, courseId } = data
38
+ const { name, description, usageLimit, courseId } = data
42
39
43
40
const course = await getCourse ( courseId )
44
41
if ( ! course ) {
@@ -48,7 +45,6 @@ adminRouter.post('/chatinstances', async (req, res) => {
48
45
const newChatInstance = await ChatInstance . create ( {
49
46
name : { en : name , fi : name , sv : name } ,
50
47
description,
51
- model,
52
48
usageLimit,
53
49
courseId,
54
50
activityPeriod : course . activityPeriod ,
@@ -162,15 +158,14 @@ adminRouter.get('/statistics', async (req, res) => {
162
158
interface UpdatedChatInstanceData {
163
159
name : string
164
160
description : string
165
- model : ValidModelName
166
161
usageLimit : number
167
162
courseId : string
168
163
}
169
164
170
165
adminRouter . put ( '/chatinstances/:id' , async ( req , res ) => {
171
166
const { id } = req . params
172
167
const data = req . body as UpdatedChatInstanceData
173
- const { description, model , usageLimit, courseId, name } = data
168
+ const { description, usageLimit, courseId, name } = data
174
169
175
170
const chatInstance = await ChatInstance . findByPk ( id )
176
171
@@ -180,7 +175,6 @@ adminRouter.put('/chatinstances/:id', async (req, res) => {
180
175
181
176
chatInstance . name = { en : name , fi : name , sv : name }
182
177
chatInstance . description = description
183
- chatInstance . model = model
184
178
chatInstance . usageLimit = usageLimit
185
179
chatInstance . courseId = courseId
186
180
0 commit comments