Skip to content

Commit

Permalink
FE-73๐Ÿ› url์œ ํšจ์„ฑ๊ฒ€์‚ฌ ์—๋Ÿฌ ๋ฉ”์„ธ์ง€ ์•ˆ๋œจ๋Š” ๋ฒ„๊ทธ ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
jisurk committed Jul 24, 2024
1 parent 6268995 commit 3c003a0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ import axios from 'axios';
import qs from 'qs';

const getToken = () =>
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MjIsInRlYW1JZCI6IjUtOSIsInNjb3BlIjoiYWNjZXNzIiwiaWF0IjoxNzIxNzQ0MDk3LCJleHAiOjE3MjE3NDU4OTcsImlzcyI6InNwLWVwaWdyYW0ifQ.vLG7eh4hG3Ka5r5xfmP9So2zt9-PcighDrTCmQ8wkAk';
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MjUsInRlYW1JZCI6IjUtOSIsInNjb3BlIjoiYWNjZXNzIiwiaWF0IjoxNzIxODAxOTU1LCJleHAiOjE3MjE4MDM3NTUsImlzcyI6InNwLWVwaWdyYW0ifQ.z_QkXSBKp6gsWH7qs_wdNqQcbzIKAiJieihWfY9LZWY';

const httpClient = axios.create({
baseURL: process.env.NEXT_PUBLIC_BASE_URL,
headers: { 'Content-Type': 'application/json' },
paramsSerializer: (parameters) => qs.stringify(parameters, { arrayFormat: 'repeat', encode: false }),
});

// NOTE: ์œ ๋ฏผ๋‹˜ interceptor ์‚ฌ์šฉ!
httpClient.interceptors.request.use(
(config) => {
const newConfig = { ...config };
Expand Down
2 changes: 1 addition & 1 deletion src/pageLayout/Epigram/AddEpigram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function AddEpigram() {
<Input
className='h-11 lg:h-16 lg:text-2xl border-blue-300 border-2 rounded-xl p-2'
id='referenceUrl'
type='url'
type='text'
placeholder='URL (ex.http://www.website.com)'
aria-label='์ถœ์ฒ˜ URL'
{...field}
Expand Down
4 changes: 2 additions & 2 deletions src/schema/addEpigram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export const AddEpigramResponseSchema = z.object({
export const AddEpigramFormSchema = z
.object({
tags: z.array(z.string().min(1).max(10)).min(1, { message: '์ตœ์†Œ 1๊ฐœ์˜ ํƒœ๊ทธ๋ฅผ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.' }).max(3),
author: z.string().min(1, { message: '์ €์ž์˜ ์ด๋ฆ„์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”' }).max(30),
author: z.string().min(1, { message: '์ €์ž์˜ ์ด๋ฆ„์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”' }).max(30, { message: '30์ž ์ด๋‚ด๋กœ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.' }),
content: z.string().min(1, { message: '๋‚ด์šฉ์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.' }).max(500, { message: '500์ž ์ด๋‚ด๋กœ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.' }),
referenceUrl: z.union([z.string().url().regex(urlRegex, { message: '์˜ฌ๋ฐ”๋ฅธ URL ํ˜•์‹์ด ์•„๋‹™๋‹ˆ๋‹ค.' }), z.literal('')]).optional(),
referenceUrl: z.union([z.string().regex(urlRegex, { message: '์˜ฌ๋ฐ”๋ฅธ URL ํ˜•์‹์ด ์•„๋‹™๋‹ˆ๋‹ค.' }), z.literal('')]).optional(),
referenceTitle: z.union([z.string().max(100, { message: '100์ž ์ด๋‚ด๋กœ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.' }), z.literal('')]).optional(),
})
.refine((data) => (data.referenceUrl === '' && data.referenceTitle === '') || (data.referenceUrl !== '' && data.referenceTitle !== ''), {
Expand Down

0 comments on commit 3c003a0

Please sign in to comment.