This commit is contained in:
@@ -64,7 +64,7 @@ export default function AccountDetails({ data }: { data: UserMetaCardProps }) {
|
||||
new_password: formValues.new_password,
|
||||
};
|
||||
|
||||
await apiChangePassword(userId, payload as any);
|
||||
await apiChangePassword(payload as any);
|
||||
closeModal();
|
||||
toast.success("Cập nhật thành công!");
|
||||
router.refresh();
|
||||
|
||||
@@ -7,7 +7,7 @@ import Button from "../ui/button/Button";
|
||||
import Input from "../form/input/InputField";
|
||||
import Label from "../form/Label";
|
||||
import { Profile, UserMetaCardProps } from "@/interface/user";
|
||||
import { apiUpdateUser, apiUpdateUserCurrent } from "@/service/userService";
|
||||
import { apiUpdateUser } from "@/service/userService";
|
||||
import { toast } from "sonner";
|
||||
import Link from "next/link";
|
||||
|
||||
@@ -51,7 +51,7 @@ export default function UserInfoCard({ data }: { data: UserMetaCardProps }) {
|
||||
if (!userId) return;
|
||||
|
||||
try {
|
||||
const response = await apiUpdateUserCurrent(formData);
|
||||
const response = await apiUpdateUser(formData);
|
||||
|
||||
if (response && response.status === false) {
|
||||
toast.error(response.message || "Cập nhật thất bại.");
|
||||
|
||||
@@ -5,7 +5,7 @@ import Image from "next/image";
|
||||
import { UserMetaCardProps } from "@/interface/user";
|
||||
import { uploadMedia } from "@/service/mediaService";
|
||||
import { toast } from "sonner";
|
||||
import { apiUpdateUser, apiUpdateUserCurrent } from "@/service/userService";
|
||||
import { apiUpdateUser } from "@/service/userService";
|
||||
import { URL_MEDIA } from "../../../api";
|
||||
|
||||
export default function UserMetaCard({ data }: { data: UserMetaCardProps }) {
|
||||
@@ -48,7 +48,7 @@ export default function UserMetaCard({ data }: { data: UserMetaCardProps }) {
|
||||
setPreviewImage(url);
|
||||
if (data.data) {
|
||||
try {
|
||||
await apiUpdateUserCurrent({ avatar_url: url });
|
||||
await apiUpdateUser({ avatar_url: url });
|
||||
toast.success("Cập nhật avatar thành công!");
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
|
||||
Reference in New Issue
Block a user