-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: api/*/update系の必須キーを最低限に #13824
base: develop
Are you sure you want to change the base?
refactor: api/*/update系の必須キーを最低限に #13824
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #13824 +/- ##
============================================
- Coverage 77.84% 66.57% -11.28%
============================================
Files 185 1012 +827
Lines 25600 120076 +94476
Branches 487 4633 +4146
============================================
+ Hits 19929 79941 +60012
- Misses 5664 40104 +34440
- Partials 7 31 +24 ☔ View full report in Codecov by Sentry. |
このPRによるapi.jsonの差分 差分はこちら--- base
+++ head
@@ -2980,16 +2980,7 @@
}
},
"required": [
- "id",
- "memo",
- "url",
- "imageUrl",
- "place",
- "priority",
- "ratio",
- "expiresAt",
- "startsAt",
- "dayOfWeek"
+ "id"
]
}
}
@@ -15079,20 +15070,7 @@
}
},
"required": [
- "roleId",
- "name",
- "description",
- "color",
- "iconUrl",
- "target",
- "condFormula",
- "isPublic",
- "isModerator",
- "isAdministrator",
- "asBadge",
- "canEditMembersByModerator",
- "displayOrder",
- "policies"
+ "roleId"
]
}
}
@@ -29660,8 +29638,7 @@
}
},
"required": [
- "clipId",
- "name"
+ "clipId"
]
}
}
@@ -38810,9 +38787,7 @@
}
},
"required": [
- "postId",
- "title",
- "fileIds"
+ "postId"
]
}
}
@@ -51476,9 +51451,11 @@
"maxLength": 1024
},
"secret": {
- "type": "string",
- "maxLength": 1024,
- "default": ""
+ "type": [
+ "string",
+ "null"
+ ],
+ "maxLength": 1024
},
"on": {
"type": "array",
@@ -51501,11 +51478,7 @@
}
},
"required": [
- "webhookId",
- "name",
- "url",
- "on",
- "active"
+ "webhookId"
]
}
}
@@ -62601,12 +62574,7 @@
}
},
"required": [
- "pageId",
- "title",
- "name",
- "content",
- "variables",
- "script"
+ "pageId"
]
}
} |
{
...(ps.secret === null ? { secret: '' } : ps.secret ? { secret: ps.secret } : {})
} のように書かないとダメそう |
実際に以下のように変えてみましたが、同様のエラーが発生するみたいです... await this.webhooksRepository.update(webhook.id, {
name: ps.name,
url: ps.url,
on: ps.on,
active: ps.active,
...(ps.secret === null ? { secret: '' } : ps.secret ? { secret: ps.secret } : {}),
}); |
🤯 |
お恥ずかしながらid以外に適当なキーを付与したら動きました。お騒がせしてすみません。 |
できました |
f8e50f1
to
f861c0b
Compare
f861c0b
to
ed2326c
Compare
pnpmのバージョンが合わなくて怒られてるので一旦#13825 を取り込むためにdevelopを取り込んだほうが良さそう |
一応プルリクがあることは把握してたんですが、私生活の方が少し忙しく最近あまり確認できてなかったので後で追従しておきます |
What
close #13398
上記の問題を解決します
Why
部分的な更新を行う際に元々の値を
show
などを用いて取得し、bodyに付けてから更新を行わないと予期せぬ上書きなどを起こしてしまい大変不便なため。Additional info (optional)
webhookに関してなのですが、以下のように
secret
を nullableにして nullを空文字、undefinedは更新を見送るといった挙動にしたかったのですが、undefinedになった際以下のようなエラーが出てしまってよく分からなかったため見送ってます。何かご存じでしたらご教授いただければ幸いです。Checklist