mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
♻️ getUser
This commit is contained in:
@ -17,6 +17,7 @@ import {
|
||||
WrenchIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import Logo from "./logo";
|
||||
import { getUser } from "@documenso/lib/api";
|
||||
|
||||
const navigation = [
|
||||
{
|
||||
@ -86,9 +87,8 @@ export default function TopNavigation() {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
// todo encapsulate
|
||||
fetch("/api/users/me").then((res) => {
|
||||
res.json().then((j) => {
|
||||
getUser().then((res) => {
|
||||
res.json().then((j: any) => {
|
||||
setUser(j);
|
||||
});
|
||||
});
|
||||
|
||||
@ -6,6 +6,7 @@ import Head from "next/head";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { updateUser } from "@documenso/features";
|
||||
import { Button } from "@documenso/ui";
|
||||
import { getUser } from "@documenso/lib/api";
|
||||
|
||||
const subNavigation = [
|
||||
{
|
||||
@ -34,9 +35,8 @@ export default function Setttings() {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
// todo encapsulate
|
||||
fetch("/api/users/me").then((res) => {
|
||||
res.json().then((j) => {
|
||||
getUser().then((res: any) => {
|
||||
res.json().then((j: any) => {
|
||||
setUser(j);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user