add: 8 achievements add: larger text setting fix: small infinite
timeline bugs
This commit is contained in:
parent
b860f74124
commit
5dd9fa01cb
19 changed files with 241 additions and 123 deletions
|
@ -37,7 +37,7 @@ pub async fn create_request(
|
|||
JsonMultipart(images, req): JsonMultipart<CreatePost>,
|
||||
) -> impl IntoResponse {
|
||||
let data = &(data.read().await).0;
|
||||
let user = match get_user_from_token!(jar, data, oauth::AppScope::UserCreatePosts) {
|
||||
let mut user = match get_user_from_token!(jar, data, oauth::AppScope::UserCreatePosts) {
|
||||
Some(ua) => ua,
|
||||
None => return Json(Error::NotAllowed.into()),
|
||||
};
|
||||
|
@ -181,7 +181,7 @@ pub async fn create_request(
|
|||
|
||||
// achievements
|
||||
if let Err(e) = data
|
||||
.add_achievement(&user, AchievementName::CreatePost.into())
|
||||
.add_achievement(&mut user, AchievementName::CreatePost.into())
|
||||
.await
|
||||
{
|
||||
return Json(e.into());
|
||||
|
@ -189,7 +189,7 @@ pub async fn create_request(
|
|||
|
||||
if user.post_count >= 49 {
|
||||
if let Err(e) = data
|
||||
.add_achievement(&user, AchievementName::Create50Posts.into())
|
||||
.add_achievement(&mut user, AchievementName::Create50Posts.into())
|
||||
.await
|
||||
{
|
||||
return Json(e.into());
|
||||
|
@ -198,7 +198,7 @@ pub async fn create_request(
|
|||
|
||||
if user.post_count >= 99 {
|
||||
if let Err(e) = data
|
||||
.add_achievement(&user, AchievementName::Create100Posts.into())
|
||||
.add_achievement(&mut user, AchievementName::Create100Posts.into())
|
||||
.await
|
||||
{
|
||||
return Json(e.into());
|
||||
|
@ -207,7 +207,7 @@ pub async fn create_request(
|
|||
|
||||
if user.post_count >= 999 {
|
||||
if let Err(e) = data
|
||||
.add_achievement(&user, AchievementName::Create1000Posts.into())
|
||||
.add_achievement(&mut user, AchievementName::Create1000Posts.into())
|
||||
.await
|
||||
{
|
||||
return Json(e.into());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue