mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 04:25:03 +02:00
UBERF-12214: Fix GitHub assignee update (#9515)
Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
@@ -329,10 +329,12 @@ export class GithubWorker implements IntegrationManager {
|
||||
.reverse()
|
||||
.join(',') // TODO: Convert first, last name
|
||||
|
||||
const infos = await this.liveQuery.findOne(github.class.GithubUserInfo, { login: userInfo.login })
|
||||
const normalizedLogin = userInfo.login.toLowerCase()
|
||||
const infos = await this.liveQuery.findOne(github.class.GithubUserInfo, { login: normalizedLogin })
|
||||
if (infos === undefined) {
|
||||
await this._client.createDoc(github.class.GithubUserInfo, contact.space.Contacts, {
|
||||
...userInfo
|
||||
...userInfo,
|
||||
login: normalizedLogin
|
||||
})
|
||||
}
|
||||
|
||||
@@ -542,15 +544,15 @@ export class GithubWorker implements IntegrationManager {
|
||||
}
|
||||
)
|
||||
const infoData = response.user
|
||||
const normalizedInfoData: Data<GithubUserInfo> = {
|
||||
...infoData,
|
||||
login: infoData.login?.toLowerCase()
|
||||
}
|
||||
if (info == null) {
|
||||
await this._client.createDoc(
|
||||
github.class.GithubUserInfo,
|
||||
contact.space.Contacts,
|
||||
infoData as Data<GithubUserInfo>
|
||||
)
|
||||
await this._client.createDoc(github.class.GithubUserInfo, contact.space.Contacts, normalizedInfoData)
|
||||
} else {
|
||||
await this._client.diffUpdate(info, {
|
||||
...infoData
|
||||
...normalizedInfoData
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user