Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinhaitao
taobao-mini-template
Commits
8b05e7b3
Commit
8b05e7b3
authored
Oct 13, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
🐛
updateTasks bug
parent
30fbef5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
task.service.ts
v2.0/src/service/task.service.ts
+20
-1
No files found.
v2.0/src/service/task.service.ts
View file @
8b05e7b3
...
@@ -501,10 +501,29 @@ export default class TaskService extends UserService {
...
@@ -501,10 +501,29 @@ export default class TaskService extends UserService {
*/
*/
async
updateTasks
(
id
:
string
,
needUpdateKeysArray
:
object
[],
userInfo
:
IUserInfo
):
Promise
<
false
|
IUserInfo
>
{
async
updateTasks
(
id
:
string
,
needUpdateKeysArray
:
object
[],
userInfo
:
IUserInfo
):
Promise
<
false
|
IUserInfo
>
{
logger
(
needUpdateKeysArray
)
logger
(
needUpdateKeysArray
)
const
updateKeys
:
object
=
merge
({},
...
needUpdateKeysArray
)
const
updateKeys
=
merge
({},
...
needUpdateKeysArray
)
logger
(
updateKeys
)
logger
(
updateKeys
)
const
_$inc
=
updateKeys
.
$inc
||
{}
const
_$set
=
updateKeys
.
$set
||
{}
const
_$push
=
updateKeys
.
$push
||
{}
// 删除空的操作
if
(
!
Object
.
keys
(
_$inc
).
length
&&
updateKeys
.
$inc
)
{
delete
updateKeys
.
$inc
}
if
(
!
Object
.
keys
(
_$set
).
length
&&
updateKeys
.
$set
)
{
delete
updateKeys
.
$set
}
if
(
!
Object
.
keys
(
_$push
).
length
&&
updateKeys
.
$push
)
{
delete
updateKeys
.
$push
}
if
(
!
Object
.
keys
(
updateKeys
).
length
)
{
return
userInfo
}
await
this
.
updateUser
(
id
,
updateKeys
)
await
this
.
updateUser
(
id
,
updateKeys
)
return
await
this
.
getUserInfo
()
return
await
this
.
getUserInfo
()
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment