Skip to content

Commit

Permalink
Merge pull request #291 from sohosai/feature/fix-slack-notify
Browse files Browse the repository at this point in the history
Slack通知のURLを実委人向けのものに修正
  • Loading branch information
arata-nvm authored May 3, 2024
2 parents 163d5d5 + d1944b7 commit d6e14b6
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/sos24-use-case/src/form/interactor/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl<R: Repositories, A: Adapters> FormUseCase<R, A> {
.notify(format!(
"申請「{}」が作成されました。\n{}",
form_title.value(),
app_url::form(ctx, form_id.clone()),
app_url::committee_form(ctx, form_id.clone()),
))
.await?;

Expand Down
2 changes: 1 addition & 1 deletion crates/sos24-use-case/src/news/interactor/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Email : {email}
.notify(format!(
"お知らせ「{}」が公開されました。\n{}",
news.title().clone().value(),
app_url::news(ctx, news_id.clone()),
app_url::committee_news(ctx, news_id.clone()),
))
.await?;

Expand Down
2 changes: 1 addition & 1 deletion crates/sos24-use-case/src/project/interactor/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl<R: Repositories, A: Adapters> ProjectUseCase<R, A> {
.notify(format!(
"企画「{}」が登録されました。\n{}",
project_title,
app_url::project(ctx, project_id.clone()),
app_url::committee_project(ctx, project_id.clone()),
))
.await?;

Expand Down
24 changes: 22 additions & 2 deletions crates/sos24-use-case/src/shared/app_url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@ pub fn news(ctx: &impl ContextProvider, news_id: NewsId) -> String {
format!("{}/news/{}", ctx.config().app_url, news_id.value())
}

pub fn project(ctx: &impl ContextProvider, project_id: ProjectId) -> String {
format!("{}/projects/{}", ctx.config().app_url, project_id.value())
pub fn committee_form(ctx: &impl ContextProvider, form_id: FormId) -> String {
format!(
"{}/committee/forms/{}",
ctx.config().app_url,
form_id.value()
)
}

pub fn committee_news(ctx: &impl ContextProvider, news_id: NewsId) -> String {
format!(
"{}/committee/news/{}",
ctx.config().app_url,
news_id.value()
)
}

pub fn committee_project(ctx: &impl ContextProvider, project_id: ProjectId) -> String {
format!(
"{}/committee/projects/{}",
ctx.config().app_url,
project_id.value()
)
}

0 comments on commit d6e14b6

Please sign in to comment.