-
Notifications
You must be signed in to change notification settings - Fork 217
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
feat: implementions of announcement creation function #8715
base: feat/announcement-function
Are you sure you want to change the base?
feat: implementions of announcement creation function #8715
Conversation
…ons-of-announcement-creation-function
…creation-function
…creation-function
|
reg-suit detected visual differences. Check this report, and review them. ⚪ What do the circles mean?The number of circles represent the number of changed images.🔴 : Changed items, ⚪ : New items, ⚫ : Deleted items, and 🔵 Passed items How can I change the check status?If reviewers approve this PR, the reg context status will be green automatically. |
…ons-of-announcement-creation-function
|
||
const loginRequiredStrictly = require('~/server/middlewares/login-required')(crowi); | ||
|
||
router.post('/', loginRequiredStrictly, async(req: CrowiRequest) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- pageId は req.params で取れる方が良さそう
- express-valudator を使ってバリデーションもする
|
||
const params: ParamsForAnnouncement = req.body; | ||
|
||
const page = await Page.findById(params.pageId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
req.paramsではpageIdが正しく取得できなかったため、この形にしています。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
クライアントのリクエスト方法がパスパラメーターで取得できるかたちになっていないのでは?
https://github.com/weseek/growi/pull/8715/files#diff-16e65c79c9018f437410fdf1211d572707905ec324e3b3129c795555aa364a5cR13
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/:id を用いることで、pageIdをパスパラメータで取得できるようにしました。
…ons-of-announcement-creation-function
|
||
const params: ParamsForAnnouncement = req.body; | ||
|
||
const page = await Page.findById(params.pageId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
クライアントのリクエスト方法がパスパラメーターで取得できるかたちになっていないのでは?
https://github.com/weseek/growi/pull/8715/files#diff-16e65c79c9018f437410fdf1211d572707905ec324e3b3129c795555aa364a5cR13
|
||
return router; | ||
|
||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これも features ディレクトリで良さそう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちら移動させていただきました。
|
||
export interface ParamsForAnnouncement extends Omit<IAnnouncement, 'receivers'> { | ||
receivers: Ref<IUser>[] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これも featues ディレクトリで良さそう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こちらも移動しました。
…creation-function
…ons-of-announcement-creation-function
タスク
https://redmine.weseek.co.jp/issues/134084
https://redmine.weseek.co.jp/issues/134085
概要
変更点
セルフチェック