mirror of
https://github.com/modrinth/code.git
synced 2026-08-26 09:34:50 +00:00
feat: access labrinth backend (#6284)
* feat: redirect `/hosting` to archon * feat: server invite notification type * feat: direct email notification endpoint * feat: revoke notification endpoint * feat: specify users to remove notifications from * refactor: insert notifications before sending emails * refactor: rename endpoint * refactor: remove archon redirect * style: mark field unused * feat: dedup external notifications * feat: add server invite email templates * style: remove unnecessary format --------- Co-authored-by: sychic <47618543+Sychic@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,7 @@ use crate::models::{
|
||||
use ariadne::ids::UserId;
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct LegacyNotification {
|
||||
@@ -66,6 +67,12 @@ pub enum LegacyNotificationBody {
|
||||
team_id: TeamId,
|
||||
role: String,
|
||||
},
|
||||
ServerInvite {
|
||||
server_id: Uuid,
|
||||
server_name: String,
|
||||
invited_by: UserId,
|
||||
role: String,
|
||||
},
|
||||
StatusChange {
|
||||
project_id: ProjectId,
|
||||
old_status: ProjectStatus,
|
||||
@@ -166,6 +173,9 @@ impl LegacyNotification {
|
||||
NotificationBody::OrganizationInvite { .. } => {
|
||||
Some("organization_invite".to_string())
|
||||
}
|
||||
NotificationBody::ServerInvite { .. } => {
|
||||
Some("server_invite".to_string())
|
||||
}
|
||||
NotificationBody::StatusChange { .. } => {
|
||||
Some("status_change".to_string())
|
||||
}
|
||||
@@ -269,6 +279,17 @@ impl LegacyNotification {
|
||||
team_id,
|
||||
role,
|
||||
},
|
||||
NotificationBody::ServerInvite {
|
||||
server_id,
|
||||
server_name,
|
||||
invited_by,
|
||||
role,
|
||||
} => LegacyNotificationBody::ServerInvite {
|
||||
server_id,
|
||||
server_name,
|
||||
invited_by,
|
||||
role,
|
||||
},
|
||||
NotificationBody::StatusChange {
|
||||
project_id,
|
||||
old_status,
|
||||
|
||||
Reference in New Issue
Block a user