mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-23 03:25:07 +03:00
Change the structure
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { checkUserSimilarity } from "@/core/api/account/profile";
|
||||
import api from "@/core/api";
|
||||
import { useUserStore } from "@/state/user";
|
||||
import { MaterialIcon } from "@/utils/material";
|
||||
|
||||
@@ -18,7 +18,7 @@ export function StatusBadge({ verified, userId, size = "small" }: StatusBadgePro
|
||||
// Check similarity for unverified users
|
||||
useEffect(() => {
|
||||
if (!verified && userId && user.authToken) {
|
||||
checkUserSimilarity(userId, user.authToken)
|
||||
api.user.profile.checkSimilarity(userId, user.authToken)
|
||||
.then(result => {
|
||||
setIsSimilarToVerified(result?.isSimilar || false);
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { verifyUser } from "@/core/api/account/profile";
|
||||
import api from "@/core/api";
|
||||
import { useUserStore } from "@/state/user";
|
||||
import { MaterialButton } from "@/utils/material";
|
||||
|
||||
@@ -23,7 +23,7 @@ export function VerifyButton({ userId, verified, onVerificationChange }: VerifyB
|
||||
|
||||
setIsVerifying(true);
|
||||
try {
|
||||
const result = await verifyUser(userId, user.authToken);
|
||||
const result = await api.moderation.users.verify(userId, user.authToken);
|
||||
if (result) {
|
||||
onVerificationChange?.(result.verified);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user