暂存
This commit is contained in:
		| @@ -5,10 +5,16 @@ import semver from 'semver'; | ||||
| const list = app.route({ | ||||
|   path: 'container', | ||||
|   key: 'list', | ||||
|   middleware: ['auth'] | ||||
| }); | ||||
|  | ||||
| list.run = async (ctx) => { | ||||
|   const tokenUser = ctx.state.tokenUser; | ||||
|   const list = await ContainerModel.findAll({ | ||||
|     order: [['updatedAt', 'DESC']], | ||||
|     where: { | ||||
|       uid: tokenUser.id, | ||||
|     }, | ||||
|   }); | ||||
|   ctx.body = list; | ||||
|   return ctx; | ||||
| @@ -42,10 +48,7 @@ add.run = async (ctx) => { | ||||
|     title: '', | ||||
|     description: '', | ||||
|     code: '', | ||||
|     source: '', | ||||
|     type: '', | ||||
|     sourceType: '', | ||||
|     data: {}, | ||||
|   }; | ||||
|   const container = { | ||||
|     ..._data, | ||||
| @@ -67,6 +70,8 @@ add.run = async (ctx) => { | ||||
|     try { | ||||
|       containerModel = await ContainerModel.create({ | ||||
|         ...container, | ||||
|         source: '', | ||||
|         sourceType: '', | ||||
|       }); | ||||
|     } catch (e) { | ||||
|       console.log('error', e); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user