Skip to content

Commit 62ca5e7

Browse files
authored
어드민 owner 정보 저장 방식 변경 (#39)
2 parents b53702b + 2cef79b commit 62ca5e7

60 files changed

Lines changed: 98 additions & 191 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

frontend/apps/admin/src/api/brand/hooks/useCreateBrandReview.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import { AxiosError } from "axios";
22
import { useMutation } from "@tanstack/react-query";
33

44
import axiosInstance from "api/axiosInstance";
5-
import { ACCEESS_TOKEN, OWNER, serverUrl } from "configs";
5+
import { ACCEESS_TOKEN, serverUrl, USER_NAME } from "configs";
66
import { BrandReview } from "../types/brandReview";
7-
import { getCookie } from "hooks/auth/useOwnerCookie";
87

98
export interface CreateBrandReviewInput {
109
user_id: number;
@@ -15,7 +14,7 @@ export const createBrandReview = async (
1514
requestBody: CreateBrandReviewInput
1615
): Promise<BrandReview> => {
1716
const token = localStorage.getItem(ACCEESS_TOKEN);
18-
const owner = getCookie(OWNER);
17+
const owner = localStorage.getItem(USER_NAME);
1918

2019
const result = await axiosInstance.post(
2120
`${serverUrl}/customers/brandReviews`,

frontend/apps/admin/src/api/brand/hooks/useDeleteBrandReview.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import { AxiosError } from "axios";
22
import { useMutation } from "@tanstack/react-query";
33

44
import axiosInstance from "api/axiosInstance";
5-
import { ACCEESS_TOKEN, OWNER, serverUrl } from "configs";
6-
import { getCookie } from "hooks/auth/useOwnerCookie";
5+
import { ACCEESS_TOKEN, serverUrl, USER_NAME } from "configs";
76

87
export const deleteBrandReview = async (review_id: number): Promise<void> => {
98
const token = localStorage.getItem(ACCEESS_TOKEN);
10-
const owner = getCookie(OWNER);
9+
const owner = localStorage.getItem(USER_NAME);
1110

1211
const response = await axiosInstance.delete(
1312
`${serverUrl}/brandReviews/${review_id}`,

frontend/apps/admin/src/api/brand/hooks/useGetBrandReviews.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { useQuery } from "@tanstack/react-query";
22
import { BrandReview } from "../types/brandReview";
33
import { BRAND_REVIEWS } from "constants/queryKeys";
4-
import { ACCEESS_TOKEN, OWNER, serverUrl } from "configs";
4+
import { ACCEESS_TOKEN, serverUrl, USER_NAME } from "configs";
55
import axios from "axios";
6-
import { getCookie } from "hooks/auth/useOwnerCookie";
76

87
export interface GetBrandReviewsOutput {
98
reviews: Array<BrandReview>;
@@ -21,7 +20,7 @@ export const getBrandReviews = async (
2120
params: GetBrandReviewsParams
2221
): Promise<GetBrandReviewsOutput> => {
2322
const token = localStorage.getItem(ACCEESS_TOKEN);
24-
const owner = getCookie(OWNER);
23+
const owner = localStorage.getItem(USER_NAME);
2524

2625
const response = await axios.get(`${serverUrl}/brandReviews`, {
2726
headers: {

frontend/apps/admin/src/api/brand/hooks/useGetQuestionCardCategories.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { useQuery } from "@tanstack/react-query";
22
import { GET_QUESTION_CATEGORIES } from "constants/queryKeys";
3-
import { ACCEESS_TOKEN, OWNER, serverUrl } from "configs";
3+
import { ACCEESS_TOKEN, serverUrl, USER_NAME } from "configs";
44
import axiosInstance from "api/axiosInstance";
5-
import { getCookie } from "hooks/auth/useOwnerCookie";
65

76
export interface GetQuestionCardCategoriesOutput {
87
id: number;
@@ -15,7 +14,7 @@ export const getQuestionCardCategories = async (
1514
brandId: number
1615
): Promise<Array<GetQuestionCardCategoriesOutput>> => {
1716
const token = localStorage.getItem(ACCEESS_TOKEN);
18-
const owner = getCookie(OWNER);
17+
const owner = localStorage.getItem(USER_NAME);
1918

2019
const response = await axiosInstance.get(
2120
`${serverUrl}/customers/questionCardCategories`,

frontend/apps/admin/src/api/brand/hooks/useGetQuestionCategories.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ import { AxiosError } from "axios";
22
import { useQuery } from "@tanstack/react-query";
33
import { GET_QUESTION_CATEGORIES } from "constants/queryKeys";
44

5-
import { ACCEESS_TOKEN, OWNER, serverUrl } from "configs";
5+
import { ACCEESS_TOKEN, serverUrl, USER_NAME } from "configs";
66
import { QuestionCardDeck } from "interfaces/questionCardCategory";
77
import axiosInstance from "api/axiosInstance";
8-
import { getCookie } from "hooks/auth/useOwnerCookie";
98

109
export interface QuestionCategoriesOutput {
1110
id: number;
@@ -22,7 +21,7 @@ export const getQuestionCategories = async (
2221
brand_id: string
2322
): Promise<QuestionCategoriesOutput> => {
2423
const token = localStorage.getItem(ACCEESS_TOKEN);
25-
const owner = getCookie(OWNER);
24+
const owner = localStorage.getItem(USER_NAME);
2625

2726
const response = await axiosInstance.get(
2827
`${serverUrl}/brands/${brand_id}/questionCardCategories/questionCards`,

frontend/apps/admin/src/api/brand/hooks/useUpdateBrandReview.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import { AxiosError } from "axios";
22
import { useMutation } from "@tanstack/react-query";
33

44
import axiosInstance from "api/axiosInstance";
5-
import { ACCEESS_TOKEN, OWNER, serverUrl } from "configs";
5+
import { ACCEESS_TOKEN, serverUrl, USER_NAME } from "configs";
66
import { BrandReview } from "../types/brandReview";
7-
import { getCookie } from "hooks/auth/useOwnerCookie";
87

98
export interface Params {
109
review_id: number;
@@ -18,7 +17,7 @@ export const updateBrandReview = async (
1817
param: Params
1918
): Promise<BrandReview> => {
2019
const token = localStorage.getItem(ACCEESS_TOKEN);
21-
const owner = getCookie(OWNER);
20+
const owner = localStorage.getItem(USER_NAME);
2221

2322
const response = await axiosInstance.put<BrandReview>(
2423
`${serverUrl}/brandReviews/${param.review_id}`,

frontend/apps/admin/src/api/channel/hooks/useGetChannels.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ import { useQuery } from "@tanstack/react-query";
22
import { AxiosError } from "axios";
33

44
import axiosInstance from "api/axiosInstance";
5-
import { ACCEESS_TOKEN, OWNER, serverUrl, USER_EMAIL } from "configs";
5+
import { ACCEESS_TOKEN, serverUrl, USER_NAME } from "configs";
66
import { GET_CHANNELS } from "constants/queryKeys";
77
import { Channel, ChannelState } from "interfaces/channels/index";
8-
import { getCookie } from "hooks/auth/useOwnerCookie";
98

109
export interface Output {
1110
channels: Array<Channel>;
@@ -23,7 +22,7 @@ export interface Params {
2322

2423
export const getChannels = async (params: Params): Promise<Output> => {
2524
const token = localStorage.getItem(ACCEESS_TOKEN);
26-
const owner = getCookie(OWNER);
25+
const owner = localStorage.getItem(USER_NAME);
2726

2827
const response = await axiosInstance.get(`${serverUrl}/channels`, {
2928
headers: {

frontend/apps/admin/src/api/landing/hooks/useDeleteGalleryImage.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import { useMutation } from "@tanstack/react-query";
22
import { AxiosError } from "axios";
3-
import { ACCEESS_TOKEN, OWNER, serverUrl } from "configs";
3+
import { ACCEESS_TOKEN, serverUrl, USER_NAME } from "configs";
44

55
import axiosInstance from "api/axiosInstance";
6-
import { getCookie } from "hooks/auth/useOwnerCookie";
76

87
export const fetchDeleteGalleryImage = async (
98
image_id: number
109
): Promise<void> => {
1110
const token = localStorage.getItem(ACCEESS_TOKEN);
12-
const owner = getCookie(OWNER);
11+
const owner = localStorage.getItem(USER_NAME);
1312

1413
const result = await axiosInstance.delete(
1514
`${serverUrl}/landingAdmin/deleteImage/gallery`,

frontend/apps/admin/src/api/landing/hooks/useDeleteMainImage.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { ACCEESS_TOKEN, OWNER, serverUrl } from "configs";
1+
import { ACCEESS_TOKEN, serverUrl, USER_NAME } from "configs";
22
import axiosInstance from "api/axiosInstance";
33
import { AxiosError } from "axios";
44
import { useMutation } from "@tanstack/react-query";
5-
import { getCookie } from "hooks/auth/useOwnerCookie";
65

76
export const fetchDeleteMainImage = async (): Promise<void> => {
87
const token = localStorage.getItem(ACCEESS_TOKEN);
9-
const owner = getCookie(OWNER);
8+
const owner = localStorage.getItem(USER_NAME);
109

1110
const result = await axiosInstance.delete(
1211
`${serverUrl}/landingAdmin/deleteImage/main`,

frontend/apps/admin/src/api/landing/hooks/useGetGalleryImages.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ import { useQuery } from "@tanstack/react-query";
22
import { AxiosError } from "axios";
33

44
import axiosInstance from "api/axiosInstance";
5-
import { ACCEESS_TOKEN, OWNER, serverUrl } from "configs";
5+
import { ACCEESS_TOKEN, serverUrl, USER_NAME } from "configs";
66
import { GET_GALLERY_IMAGES } from "constants/queryKeys";
7-
import { getCookie } from "hooks/auth/useOwnerCookie";
87

98
export const fetchGetGalleryImages = async (): Promise<
109
Array<{ id: number; url: string }>
1110
> => {
1211
const token = localStorage.getItem(ACCEESS_TOKEN);
13-
const owner = getCookie(OWNER);
12+
const owner = localStorage.getItem(USER_NAME);
1413

1514
const response = await axiosInstance.get(
1615
`${serverUrl}/landingAdmin/galleryImages`,

0 commit comments

Comments
 (0)