fix #508 searching bug

pull/513/head 0.0.1
huoyong.msb 6 years ago
parent 97de46e539
commit 2502acbf45

@ -41,9 +41,11 @@ router.get('/account/list', async (ctx) => {
let { name } = ctx.query
if (name) {
Object.assign(where, {
[Op.or]: [
{ fullname: { $like: `%${name}%` } },
],
[Op.or]: [{
fullname: {
[Op.like]: `%${name}%`
},
}],
})
}
let options = { where }

@ -6,6 +6,7 @@ require('./organization')
require('./repository')
require('./mock')
require('./analytics')
// require('./foreign')
require('./postman')
export default router

@ -582,7 +582,7 @@ router.post('/interface/move', async (ctx) => {
})
await itf.save()
} else if (op === OP_COPY) {
const { id, name, ...otherProps } = itf
const { id, name, ...otherProps } = itf.toJSON() as Interface
const newItf = await Interface.create({
name: name + '副本',
...otherProps,
@ -598,7 +598,7 @@ router.post('/interface/move', async (ctx) => {
// 解决parentId丢失的问题
let idMap = {}
for (const property of properties) {
const { id, parentId, ...props } = property
const { id, parentId, ...props } = property.toJSON() as Property
// @ts-ignore
const newParentId = idMap[parentId + ''] ? idMap[parentId + ''] : -1
const newProperty = await Property.create({

Loading…
Cancel
Save