Add notification for project status updates (#511)

* Add notification for project status updates

* aaaaaa

* cargo sqlx prepare

* use friendly name of statuses

* Update src/models/projects.rs

Co-authored-by: triphora <emma@modrinth.com>

* only send notifications to accepted users

* only send notifications for people not on the team

* cargo sqlx prepare

* !=

* fully address pr comments

Co-authored-by: triphora <emma@modrinth.com>
Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
BasiqueEvangelist
2022-12-31 00:40:00 +03:00
committed by GitHub
parent 34af33607b
commit 161dee89ec
3 changed files with 71 additions and 2 deletions

View File

@@ -319,6 +319,20 @@ impl ProjectStatus {
ProjectStatus::Private => "private",
}
}
pub fn as_friendly_str(&self) -> &'static str {
match self {
ProjectStatus::Approved => "Listed",
ProjectStatus::Rejected => "Rejected",
ProjectStatus::Draft => "Draft",
ProjectStatus::Unlisted => "Unlisted",
ProjectStatus::Processing => "Under review",
ProjectStatus::Unknown => "Unknown",
ProjectStatus::Archived => "Archived",
ProjectStatus::Withheld => "Withheld",
ProjectStatus::Scheduled => "Scheduled",
ProjectStatus::Private => "Private",
}
}
pub fn iterator() -> impl Iterator<Item = ProjectStatus> {
[