add: user achievements
This commit is contained in:
parent
e7c4cf14aa
commit
b860f74124
15 changed files with 318 additions and 11 deletions
|
@ -11,7 +11,7 @@ use axum::{
|
|||
};
|
||||
use axum_extra::extract::CookieJar;
|
||||
use tetratto_core::model::{
|
||||
auth::{FollowResult, IpBlock, Notification, UserBlock, UserFollow},
|
||||
auth::{AchievementName, FollowResult, IpBlock, Notification, UserBlock, UserFollow},
|
||||
oauth,
|
||||
};
|
||||
|
||||
|
@ -59,6 +59,13 @@ pub async fn follow_request(
|
|||
return Json(e.into());
|
||||
};
|
||||
|
||||
if let Err(e) = data
|
||||
.add_achievement(&user, AchievementName::FollowUser.into())
|
||||
.await
|
||||
{
|
||||
return Json(e.into());
|
||||
}
|
||||
|
||||
Json(ApiReturn {
|
||||
ok: true,
|
||||
message: "User followed".to_string(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue