chore: main 병합 — 로그인 없이 댓글·좋아요, 구글 로그인만, 동네 이야기·카드뉴스 등 (차단 표 user_block 하나로 합침, 익명 댓글도 신고 가능)
This commit is contained in:
commit
dba34675c8
408 files changed
+36377
-725
No files matched your search
@@ -3,8 +3,8 @@
|
||||
import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, type UseMutationOptions } from '@tanstack/react-query';
|
||||
|
||||
import { client } from '../client.gen';
|
||||
import { addComment, agreeTerms, authConfig, blockAuthor, deleteComment, getArticle, getFeed, getImage, getIndex, getPost, getSeasonWeek, getSky, getSkyRanking, getTodayPage, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, googleLogin, healthzHealthzGet, likeComment, likePost, listArticles, listBlocked, listComments, listEvents, listIndices, listPlaces, listRegions, listSaved, login, logout, me, nearestRegion, type Options, refresh, reportComment, savePost, signup, unblock, unlikeComment, unlikePost, unsavePost, updateMe, withdraw } from '../sdk.gen';
|
||||
import type { AddCommentData, AddCommentError, AddCommentResponse, AgreeTermsData, AgreeTermsError, AgreeTermsResponse, AuthConfigData, AuthConfigResponse, BlockAuthorData, BlockAuthorError, BlockAuthorResponse, DeleteCommentData, DeleteCommentError, DeleteCommentResponse, GetArticleData, GetArticleError, GetArticleResponse, GetFeedData, GetFeedError, GetFeedResponse, GetImageData, GetImageError, GetIndexData, GetIndexError, GetIndexResponse, GetPostData, GetPostError, GetPostResponse, GetSeasonWeekData, GetSeasonWeekResponse, GetSkyData, GetSkyError, GetSkyRankingData, GetSkyRankingResponse, GetSkyResponse, GetTodayPageData, GetTodayPageError, GetTodayPageResponse, GetWatchSummaryData, GetWatchSummaryError, GetWatchSummaryResponse, GetWeatherNowData, GetWeatherNowError, GetWeatherNowResponse, GetWeatherTodayData, GetWeatherTodayError, GetWeatherTodayResponse, GetWeekData, GetWeekError, GetWeekRankingData, GetWeekRankingResponse, GetWeekResponse, GoogleLoginData, GoogleLoginError, GoogleLoginResponse, HealthzHealthzGetData, HealthzHealthzGetResponse, LikeCommentData, LikeCommentError, LikeCommentResponse, LikePostData, LikePostError, LikePostResponse, ListArticlesData, ListArticlesError, ListArticlesResponse, ListBlockedData, ListBlockedError, ListBlockedResponse, ListCommentsData, ListCommentsError, ListCommentsResponse, ListEventsData, ListEventsError, ListEventsResponse, ListIndicesData, ListIndicesError, ListIndicesResponse, ListPlacesData, ListPlacesError, ListPlacesResponse, ListRegionsData, ListRegionsError, ListRegionsResponse, ListSavedData, ListSavedError, ListSavedResponse, LoginData, LoginError, LoginResponse, LogoutData, LogoutError, LogoutResponse, MeData, MeError, MeResponse, NearestRegionData, NearestRegionError, NearestRegionResponse, RefreshData, RefreshError, RefreshResponse, ReportCommentData, ReportCommentError, ReportCommentResponse, SavePostData, SavePostError, SavePostResponse, SignupData, SignupError, SignupResponse, UnblockData, UnblockError, UnblockResponse, UnlikeCommentData, UnlikeCommentError, UnlikeCommentResponse, UnlikePostData, UnlikePostError, UnlikePostResponse, UnsavePostData, UnsavePostError, UnsavePostResponse, UpdateMeData, UpdateMeError, UpdateMeResponse, WithdrawData, WithdrawError, WithdrawResponse } from '../types.gen';
|
||||
import { addComment, addMyGak, addTalk, agreeTerms, authConfig, blockAuthor, blockTalkAuthor, createCard, createReel, deleteComment, deleteMyGak, deleteTalk, getArticle, getCardImage, getFeed, getImage, getIndex, getPost, getReelCover, getReelVideo, getSeasonWeek, getSky, getSkyRanking, getTalkImage, getTodayGuPage, getTodayPage, getTomorrowGuPage, getTomorrowPage, getWatchSummary, getWeatherNow, getWeatherToday, getWeek, getWeekRanking, googleLogin, healthzHealthzGet, likeComment, likePost, likeTalk, listArticles, listBlocked, listCards, listComments, listEvents, listIndices, listMyGak, listMyTalks, listPlaces, listPresets, listReels, listRegions, listSaved, listTalks, login, logout, me, nearestRegion, type Options, publishCard, publishInstagram, publishInstagram2, refresh, rejectCard, reportComment, reportTalk, savePost, scoreMyGak, signup, talkGroups, unblock, unlikeComment, unlikePost, unlikeTalk, unsavePost, updateMe, uploadTalkImage, withdraw } from '../sdk.gen';
|
||||
import type { AddCommentData, AddCommentError, AddCommentResponse, AddMyGakData, AddMyGakError, AddMyGakResponse, AddTalkData, AddTalkError, AddTalkResponse, AgreeTermsData, AgreeTermsError, AgreeTermsResponse, AuthConfigData, AuthConfigResponse, BlockAuthorData, BlockAuthorError, BlockAuthorResponse, BlockTalkAuthorData, BlockTalkAuthorError, BlockTalkAuthorResponse, CreateCardData, CreateCardError, CreateCardResponse, CreateReelData, CreateReelError, CreateReelResponse, DeleteCommentData, DeleteCommentError, DeleteCommentResponse, DeleteMyGakData, DeleteMyGakError, DeleteMyGakResponse, DeleteTalkData, DeleteTalkError, DeleteTalkResponse, GetArticleData, GetArticleError, GetArticleResponse, GetCardImageData, GetCardImageError, GetFeedData, GetFeedError, GetFeedResponse, GetImageData, GetImageError, GetIndexData, GetIndexError, GetIndexResponse, GetPostData, GetPostError, GetPostResponse, GetReelCoverData, GetReelCoverError, GetReelVideoData, GetReelVideoError, GetSeasonWeekData, GetSeasonWeekResponse, GetSkyData, GetSkyError, GetSkyRankingData, GetSkyRankingResponse, GetSkyResponse, GetTalkImageData, GetTalkImageError, GetTodayGuPageData, GetTodayGuPageError, GetTodayGuPageResponse, GetTodayPageData, GetTodayPageError, GetTodayPageResponse, GetTomorrowGuPageData, GetTomorrowGuPageError, GetTomorrowGuPageResponse, GetTomorrowPageData, GetTomorrowPageError, GetTomorrowPageResponse, GetWatchSummaryData, GetWatchSummaryError, GetWatchSummaryResponse, GetWeatherNowData, GetWeatherNowError, GetWeatherNowResponse, GetWeatherTodayData, GetWeatherTodayError, GetWeatherTodayResponse, GetWeekData, GetWeekError, GetWeekRankingData, GetWeekRankingResponse, GetWeekResponse, GoogleLoginData, GoogleLoginError, GoogleLoginResponse, HealthzHealthzGetData, HealthzHealthzGetResponse, LikeCommentData, LikeCommentError, LikeCommentResponse, LikePostData, LikePostError, LikePostResponse, LikeTalkData, LikeTalkError, LikeTalkResponse, ListArticlesData, ListArticlesError, ListArticlesResponse, ListBlockedData, ListBlockedError, ListBlockedResponse, ListCardsData, ListCardsError, ListCardsResponse, ListCommentsData, ListCommentsError, ListCommentsResponse, ListEventsData, ListEventsError, ListEventsResponse, ListIndicesData, ListIndicesError, ListIndicesResponse, ListMyGakData, ListMyGakError, ListMyGakResponse, ListMyTalksData, ListMyTalksError, ListMyTalksResponse, ListPlacesData, ListPlacesError, ListPlacesResponse, ListPresetsData, ListPresetsResponse, ListReelsData, ListReelsError, ListReelsResponse, ListRegionsData, ListRegionsError, ListRegionsResponse, ListSavedData, ListSavedError, ListSavedResponse, ListTalksData, ListTalksError, ListTalksResponse, LoginData, LoginError, LoginResponse, LogoutData, LogoutError, LogoutResponse, MeData, MeError, MeResponse, NearestRegionData, NearestRegionError, NearestRegionResponse, PublishCardData, PublishCardError, PublishCardResponse, PublishInstagram2Data, PublishInstagram2Error, PublishInstagram2Response, PublishInstagramData, PublishInstagramError, PublishInstagramResponse, RefreshData, RefreshError, RefreshResponse, RejectCardData, RejectCardError, RejectCardResponse, ReportCommentData, ReportCommentError, ReportCommentResponse, ReportTalkData, ReportTalkError, ReportTalkResponse, SavePostData, SavePostError, SavePostResponse, ScoreMyGakData, ScoreMyGakError, ScoreMyGakResponse, SignupData, SignupError, SignupResponse, TalkGroupsData, TalkGroupsError, TalkGroupsResponse, UnblockData, UnblockError, UnblockResponse, UnlikeCommentData, UnlikeCommentError, UnlikeCommentResponse, UnlikePostData, UnlikePostError, UnlikePostResponse, UnlikeTalkData, UnlikeTalkError, UnlikeTalkResponse, UnsavePostData, UnsavePostError, UnsavePostResponse, UpdateMeData, UpdateMeError, UpdateMeResponse, UploadTalkImageData, UploadTalkImageError, UploadTalkImageResponse, WithdrawData, WithdrawError, WithdrawResponse } from '../types.gen';
|
||||
|
||||
export type QueryKey<TOptions extends Options> = [
|
||||
Pick<TOptions, 'baseUrl' | 'body' | 'headers' | 'path' | 'query'> & {
|
||||
@@ -78,7 +78,7 @@ export const nearestRegionOptions = (options: Options<NearestRegionData>) => que
|
||||
export const getWeatherTodayQueryKey = (options: Options<GetWeatherTodayData>) => createQueryKey('getWeatherToday', options);
|
||||
|
||||
/**
|
||||
* 오늘 3시간 칸 날씨
|
||||
* 오늘(또는 내일) 3시간 칸 날씨
|
||||
*/
|
||||
export const getWeatherTodayOptions = (options: Options<GetWeatherTodayData>) => queryOptions<GetWeatherTodayResponse, GetWeatherTodayError, GetWeatherTodayResponse, ReturnType<typeof getWeatherTodayQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
@@ -535,7 +535,7 @@ export const unlikePostMutation = (options?: Partial<Options<UnlikePostData>>):
|
||||
};
|
||||
|
||||
/**
|
||||
* 좋아요
|
||||
* 좋아요 (로그인 없으면 IP 당 한 번)
|
||||
*/
|
||||
export const likePostMutation = (options?: Partial<Options<LikePostData>>): UseMutationOptions<LikePostResponse, LikePostError, Options<LikePostData>> => {
|
||||
const mutationOptions: UseMutationOptions<LikePostResponse, LikePostError, Options<LikePostData>> = {
|
||||
@@ -711,7 +711,7 @@ export const listCommentsInfiniteOptions = (options: Options<ListCommentsData>)
|
||||
};
|
||||
|
||||
/**
|
||||
* 댓글 쓰기 (60자, 이용약관 동의 전이면 TERMS_REQUIRED)
|
||||
* 댓글 쓰기 (60자, 로그인 없으면 '동네 익명'으로 IP 당 하루 20개, 로그인했는데 이용약관 동의 전이면 TERMS_REQUIRED)
|
||||
*/
|
||||
export const addCommentMutation = (options?: Partial<Options<AddCommentData>>): UseMutationOptions<AddCommentResponse, AddCommentError, Options<AddCommentData>> => {
|
||||
const mutationOptions: UseMutationOptions<AddCommentResponse, AddCommentError, Options<AddCommentData>> = {
|
||||
@@ -728,7 +728,7 @@ export const addCommentMutation = (options?: Partial<Options<AddCommentData>>):
|
||||
};
|
||||
|
||||
/**
|
||||
* 내 댓글 지우기
|
||||
* 내 댓글 지우기 (로그인 없이 쓴 댓글은 같은 IP 에서)
|
||||
*/
|
||||
export const deleteCommentMutation = (options?: Partial<Options<DeleteCommentData>>): UseMutationOptions<DeleteCommentResponse, DeleteCommentError, Options<DeleteCommentData>> => {
|
||||
const mutationOptions: UseMutationOptions<DeleteCommentResponse, DeleteCommentError, Options<DeleteCommentData>> = {
|
||||
@@ -762,7 +762,7 @@ export const unlikeCommentMutation = (options?: Partial<Options<UnlikeCommentDat
|
||||
};
|
||||
|
||||
/**
|
||||
* 댓글 좋아요
|
||||
* 댓글 좋아요 (로그인 없으면 IP 당 한 번)
|
||||
*/
|
||||
export const likeCommentMutation = (options?: Partial<Options<LikeCommentData>>): UseMutationOptions<LikeCommentResponse, LikeCommentError, Options<LikeCommentData>> => {
|
||||
const mutationOptions: UseMutationOptions<LikeCommentResponse, LikeCommentError, Options<LikeCommentData>> = {
|
||||
@@ -847,6 +847,344 @@ export const unblockMutation = (options?: Partial<Options<UnblockData>>): UseMut
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const listMyGakQueryKey = (options?: Options<ListMyGakData>) => createQueryKey('listMyGak', options);
|
||||
|
||||
/**
|
||||
* 내 각 목록 (로그인하지 않았으면 빈 목록)
|
||||
*/
|
||||
export const listMyGakOptions = (options?: Options<ListMyGakData>) => queryOptions<ListMyGakResponse, ListMyGakError, ListMyGakResponse, ReturnType<typeof listMyGakQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listMyGak({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listMyGakQueryKey(options)
|
||||
});
|
||||
|
||||
/**
|
||||
* 이름과 날씨 조건으로 내 각 만들기
|
||||
*/
|
||||
export const addMyGakMutation = (options?: Partial<Options<AddMyGakData>>): UseMutationOptions<AddMyGakResponse, AddMyGakError, Options<AddMyGakData>> => {
|
||||
const mutationOptions: UseMutationOptions<AddMyGakResponse, AddMyGakError, Options<AddMyGakData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await addMyGak({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const listPresetsQueryKey = (options?: Options<ListPresetsData>) => createQueryKey('listPresets', options);
|
||||
|
||||
/**
|
||||
* 공식 각을 내 각 조건으로 옮긴 목록 (내 각 만들기에서 골라 채우기)
|
||||
*/
|
||||
export const listPresetsOptions = (options?: Options<ListPresetsData>) => queryOptions<ListPresetsResponse, DefaultError, ListPresetsResponse, ReturnType<typeof listPresetsQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listPresets({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listPresetsQueryKey(options)
|
||||
});
|
||||
|
||||
/**
|
||||
* 조건들의 그 동네 오늘 점수 (로그인 없이, 받은 링크의 각도)
|
||||
*/
|
||||
export const scoreMyGakMutation = (options?: Partial<Options<ScoreMyGakData>>): UseMutationOptions<ScoreMyGakResponse, ScoreMyGakError, Options<ScoreMyGakData>> => {
|
||||
const mutationOptions: UseMutationOptions<ScoreMyGakResponse, ScoreMyGakError, Options<ScoreMyGakData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await scoreMyGak({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 내 각 지우기
|
||||
*/
|
||||
export const deleteMyGakMutation = (options?: Partial<Options<DeleteMyGakData>>): UseMutationOptions<DeleteMyGakResponse, DeleteMyGakError, Options<DeleteMyGakData>> => {
|
||||
const mutationOptions: UseMutationOptions<DeleteMyGakResponse, DeleteMyGakError, Options<DeleteMyGakData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await deleteMyGak({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const talkGroupsQueryKey = (options?: Options<TalkGroupsData>) => createQueryKey('talkGroups', options);
|
||||
|
||||
/**
|
||||
* 오늘 피드 묶음 (동네 사람들 + 주제별, 가까운 동네·덜 지난 글 먼저, 한 사람 한 장)
|
||||
*/
|
||||
export const talkGroupsOptions = (options?: Options<TalkGroupsData>) => queryOptions<TalkGroupsResponse, TalkGroupsError, TalkGroupsResponse, ReturnType<typeof talkGroupsQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await talkGroups({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: talkGroupsQueryKey(options)
|
||||
});
|
||||
|
||||
export const listTalksQueryKey = (options?: Options<ListTalksData>) => createQueryKey('listTalks', options);
|
||||
|
||||
/**
|
||||
* 동네 이야기 (전국 최신순, 보는 동네와 같은 시도 글은 앞으로, 같은 사람 글은 띄움, 로그인 없이 보기)
|
||||
*/
|
||||
export const listTalksOptions = (options?: Options<ListTalksData>) => queryOptions<ListTalksResponse, ListTalksError, ListTalksResponse, ReturnType<typeof listTalksQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listTalks({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listTalksQueryKey(options)
|
||||
});
|
||||
|
||||
export const listTalksInfiniteQueryKey = (options?: Options<ListTalksData>): QueryKey<Options<ListTalksData>> => createQueryKey('listTalks', options, true);
|
||||
|
||||
/**
|
||||
* 동네 이야기 (전국 최신순, 보는 동네와 같은 시도 글은 앞으로, 같은 사람 글은 띄움, 로그인 없이 보기)
|
||||
*/
|
||||
export const listTalksInfiniteOptions = (options?: Options<ListTalksData>) => {
|
||||
const opts = infiniteQueryOptions<ListTalksResponse, ListTalksError, InfiniteData<ListTalksResponse>, QueryKey<Options<ListTalksData>>, string | null | Pick<QueryKey<Options<ListTalksData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
||||
// @ts-ignore
|
||||
{
|
||||
queryFn: async ({ pageParam, queryKey, signal }) => {
|
||||
// @ts-ignore
|
||||
const page: Pick<QueryKey<Options<ListTalksData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
||||
query: {
|
||||
cursor: pageParam
|
||||
}
|
||||
};
|
||||
const params = createInfiniteParams(queryKey, page);
|
||||
const { data } = await listTalks({
|
||||
...options,
|
||||
...params,
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listTalksInfiniteQueryKey(options)
|
||||
});
|
||||
return opts as Omit<typeof opts, 'initialData'>;
|
||||
};
|
||||
|
||||
export const listMyTalksQueryKey = (options?: Options<ListMyTalksData>) => createQueryKey('listMyTalks', options);
|
||||
|
||||
/**
|
||||
* 내가 쓴 글 (최신순)
|
||||
*/
|
||||
export const listMyTalksOptions = (options?: Options<ListMyTalksData>) => queryOptions<ListMyTalksResponse, ListMyTalksError, ListMyTalksResponse, ReturnType<typeof listMyTalksQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listMyTalks({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listMyTalksQueryKey(options)
|
||||
});
|
||||
|
||||
export const listMyTalksInfiniteQueryKey = (options?: Options<ListMyTalksData>): QueryKey<Options<ListMyTalksData>> => createQueryKey('listMyTalks', options, true);
|
||||
|
||||
/**
|
||||
* 내가 쓴 글 (최신순)
|
||||
*/
|
||||
export const listMyTalksInfiniteOptions = (options?: Options<ListMyTalksData>) => {
|
||||
const opts = infiniteQueryOptions<ListMyTalksResponse, ListMyTalksError, InfiniteData<ListMyTalksResponse>, QueryKey<Options<ListMyTalksData>>, string | null | Pick<QueryKey<Options<ListMyTalksData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
|
||||
// @ts-ignore
|
||||
{
|
||||
queryFn: async ({ pageParam, queryKey, signal }) => {
|
||||
// @ts-ignore
|
||||
const page: Pick<QueryKey<Options<ListMyTalksData>>[0], 'body' | 'headers' | 'path' | 'query'> = typeof pageParam === 'object' ? pageParam : {
|
||||
query: {
|
||||
cursor: pageParam
|
||||
}
|
||||
};
|
||||
const params = createInfiniteParams(queryKey, page);
|
||||
const { data } = await listMyTalks({
|
||||
...options,
|
||||
...params,
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listMyTalksInfiniteQueryKey(options)
|
||||
});
|
||||
return opts as Omit<typeof opts, 'initialData'>;
|
||||
};
|
||||
|
||||
/**
|
||||
* 동네 이야기 쓰기 (링크·전화번호 불가, 하루 5개)
|
||||
*/
|
||||
export const addTalkMutation = (options?: Partial<Options<AddTalkData>>): UseMutationOptions<AddTalkResponse, AddTalkError, Options<AddTalkData>> => {
|
||||
const mutationOptions: UseMutationOptions<AddTalkResponse, AddTalkError, Options<AddTalkData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await addTalk({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 글에 붙일 사진 올리기 (10MB까지, 위치 정보를 지우고 1080px로 줄여 저장)
|
||||
*/
|
||||
export const uploadTalkImageMutation = (options?: Partial<Options<UploadTalkImageData>>): UseMutationOptions<UploadTalkImageResponse, UploadTalkImageError, Options<UploadTalkImageData>> => {
|
||||
const mutationOptions: UseMutationOptions<UploadTalkImageResponse, UploadTalkImageError, Options<UploadTalkImageData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await uploadTalkImage({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getTalkImageQueryKey = (options: Options<GetTalkImageData>) => createQueryKey('getTalkImage', options);
|
||||
|
||||
/**
|
||||
* 올린 사진
|
||||
*/
|
||||
export const getTalkImageOptions = (options: Options<GetTalkImageData>) => queryOptions<unknown, GetTalkImageError, unknown, ReturnType<typeof getTalkImageQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getTalkImage({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getTalkImageQueryKey(options)
|
||||
});
|
||||
|
||||
/**
|
||||
* 내 이야기 지우기
|
||||
*/
|
||||
export const deleteTalkMutation = (options?: Partial<Options<DeleteTalkData>>): UseMutationOptions<DeleteTalkResponse, DeleteTalkError, Options<DeleteTalkData>> => {
|
||||
const mutationOptions: UseMutationOptions<DeleteTalkResponse, DeleteTalkError, Options<DeleteTalkData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await deleteTalk({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 이야기 좋아요 취소
|
||||
*/
|
||||
export const unlikeTalkMutation = (options?: Partial<Options<UnlikeTalkData>>): UseMutationOptions<UnlikeTalkResponse, UnlikeTalkError, Options<UnlikeTalkData>> => {
|
||||
const mutationOptions: UseMutationOptions<UnlikeTalkResponse, UnlikeTalkError, Options<UnlikeTalkData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await unlikeTalk({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 이야기 좋아요 (로그인 없으면 IP 당 한 번)
|
||||
*/
|
||||
export const likeTalkMutation = (options?: Partial<Options<LikeTalkData>>): UseMutationOptions<LikeTalkResponse, LikeTalkError, Options<LikeTalkData>> => {
|
||||
const mutationOptions: UseMutationOptions<LikeTalkResponse, LikeTalkError, Options<LikeTalkData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await likeTalk({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 이야기 신고 (서로 다른 3명이면 숨김)
|
||||
*/
|
||||
export const reportTalkMutation = (options?: Partial<Options<ReportTalkData>>): UseMutationOptions<ReportTalkResponse, ReportTalkError, Options<ReportTalkData>> => {
|
||||
const mutationOptions: UseMutationOptions<ReportTalkResponse, ReportTalkError, Options<ReportTalkData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await reportTalk({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 이 글 쓴 사람의 글 안 보기
|
||||
*/
|
||||
export const blockTalkAuthorMutation = (options?: Partial<Options<BlockTalkAuthorData>>): UseMutationOptions<BlockTalkAuthorResponse, BlockTalkAuthorError, Options<BlockTalkAuthorData>> => {
|
||||
const mutationOptions: UseMutationOptions<BlockTalkAuthorResponse, BlockTalkAuthorError, Options<BlockTalkAuthorData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await blockTalkAuthor({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getWatchSummaryQueryKey = (options: Options<GetWatchSummaryData>) => createQueryKey('getWatchSummary', options);
|
||||
|
||||
/**
|
||||
@@ -901,6 +1239,252 @@ export const getTodayPageOptions = (options: Options<GetTodayPageData>) => query
|
||||
queryKey: getTodayPageQueryKey(options)
|
||||
});
|
||||
|
||||
export const getTodayGuPageQueryKey = (options: Options<GetTodayGuPageData>) => createQueryKey('getTodayGuPage', options);
|
||||
|
||||
/**
|
||||
* 구로 나뉜 시의 구 페이지 (/today/gyeonggi/seongnam/bundang)
|
||||
*/
|
||||
export const getTodayGuPageOptions = (options: Options<GetTodayGuPageData>) => queryOptions<GetTodayGuPageResponse, GetTodayGuPageError, GetTodayGuPageResponse, ReturnType<typeof getTodayGuPageQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getTodayGuPage({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getTodayGuPageQueryKey(options)
|
||||
});
|
||||
|
||||
export const getTomorrowPageQueryKey = (options: Options<GetTomorrowPageData>) => createQueryKey('getTomorrowPage', options);
|
||||
|
||||
/**
|
||||
* 지역 내일 날씨 페이지: 정적 HTML 에 내일 예보를 채운다 (nginx 가 /tomorrow/... 를 넘김)
|
||||
*/
|
||||
export const getTomorrowPageOptions = (options: Options<GetTomorrowPageData>) => queryOptions<GetTomorrowPageResponse, GetTomorrowPageError, GetTomorrowPageResponse, ReturnType<typeof getTomorrowPageQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getTomorrowPage({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getTomorrowPageQueryKey(options)
|
||||
});
|
||||
|
||||
export const getTomorrowGuPageQueryKey = (options: Options<GetTomorrowGuPageData>) => createQueryKey('getTomorrowGuPage', options);
|
||||
|
||||
/**
|
||||
* 구로 나뉜 시의 구 내일 날씨 페이지
|
||||
*/
|
||||
export const getTomorrowGuPageOptions = (options: Options<GetTomorrowGuPageData>) => queryOptions<GetTomorrowGuPageResponse, GetTomorrowGuPageError, GetTomorrowGuPageResponse, ReturnType<typeof getTomorrowGuPageQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getTomorrowGuPage({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getTomorrowGuPageQueryKey(options)
|
||||
});
|
||||
|
||||
export const listCardsQueryKey = (options?: Options<ListCardsData>) => createQueryKey('listCards', options);
|
||||
|
||||
/**
|
||||
* 만든 카드뉴스 목록 (관리자). 다시 내려받거나 올릴 때
|
||||
*/
|
||||
export const listCardsOptions = (options?: Options<ListCardsData>) => queryOptions<ListCardsResponse, ListCardsError, ListCardsResponse, ReturnType<typeof listCardsQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listCards({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listCardsQueryKey(options)
|
||||
});
|
||||
|
||||
/**
|
||||
* 카드뉴스 저장 (관리자). publish 면 바로 그날 피드에 올린다
|
||||
*/
|
||||
export const createCardMutation = (options?: Partial<Options<CreateCardData>>): UseMutationOptions<CreateCardResponse, CreateCardError, Options<CreateCardData>> => {
|
||||
const mutationOptions: UseMutationOptions<CreateCardResponse, CreateCardError, Options<CreateCardData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await createCard({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 승인 대기 카드뉴스를 그날 피드에 올리기 (관리자)
|
||||
*/
|
||||
export const publishCardMutation = (options?: Partial<Options<PublishCardData>>): UseMutationOptions<PublishCardResponse, PublishCardError, Options<PublishCardData>> => {
|
||||
const mutationOptions: UseMutationOptions<PublishCardResponse, PublishCardError, Options<PublishCardData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await publishCard({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 승인 대기 카드뉴스 반려 (관리자)
|
||||
*/
|
||||
export const rejectCardMutation = (options?: Partial<Options<RejectCardData>>): UseMutationOptions<RejectCardResponse, RejectCardError, Options<RejectCardData>> => {
|
||||
const mutationOptions: UseMutationOptions<RejectCardResponse, RejectCardError, Options<RejectCardData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await rejectCard({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 카드뉴스를 인스타그램에 캐러셀로 올리기 (관리자). 같은 카드는 한 번만
|
||||
*/
|
||||
export const publishInstagramMutation = (options?: Partial<Options<PublishInstagramData>>): UseMutationOptions<PublishInstagramResponse, PublishInstagramError, Options<PublishInstagramData>> => {
|
||||
const mutationOptions: UseMutationOptions<PublishInstagramResponse, PublishInstagramError, Options<PublishInstagramData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await publishInstagram({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getCardImageQueryKey = (options: Options<GetCardImageData>) => createQueryKey('getCardImage', options);
|
||||
|
||||
/**
|
||||
* 카드뉴스 이미지
|
||||
*/
|
||||
export const getCardImageOptions = (options: Options<GetCardImageData>) => queryOptions<unknown, GetCardImageError, unknown, ReturnType<typeof getCardImageQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getCardImage({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getCardImageQueryKey(options)
|
||||
});
|
||||
|
||||
export const listReelsQueryKey = (options?: Options<ListReelsData>) => createQueryKey('listReels', options);
|
||||
|
||||
/**
|
||||
* 릴스 목록 (관리자)
|
||||
*/
|
||||
export const listReelsOptions = (options?: Options<ListReelsData>) => queryOptions<ListReelsResponse, ListReelsError, ListReelsResponse, ReturnType<typeof listReelsQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await listReels({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: listReelsQueryKey(options)
|
||||
});
|
||||
|
||||
/**
|
||||
* 릴스 mp4 저장 (관리자). 공개 주소가 생기고, 인스타엔 따로 올린다
|
||||
*/
|
||||
export const createReelMutation = (options?: Partial<Options<CreateReelData>>): UseMutationOptions<CreateReelResponse, CreateReelError, Options<CreateReelData>> => {
|
||||
const mutationOptions: UseMutationOptions<CreateReelResponse, CreateReelError, Options<CreateReelData>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await createReel({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* 릴스를 인스타그램에 올리기 (관리자). 같은 릴스는 한 번만
|
||||
*/
|
||||
export const publishInstagram2Mutation = (options?: Partial<Options<PublishInstagram2Data>>): UseMutationOptions<PublishInstagram2Response, PublishInstagram2Error, Options<PublishInstagram2Data>> => {
|
||||
const mutationOptions: UseMutationOptions<PublishInstagram2Response, PublishInstagram2Error, Options<PublishInstagram2Data>> = {
|
||||
mutationFn: async (fnOptions) => {
|
||||
const { data } = await publishInstagram2({
|
||||
...options,
|
||||
...fnOptions,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
}
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getReelVideoQueryKey = (options: Options<GetReelVideoData>) => createQueryKey('getReelVideo', options);
|
||||
|
||||
/**
|
||||
* 릴스 영상 (인스타가 받아 가는 공개 주소, Range 지원)
|
||||
*/
|
||||
export const getReelVideoOptions = (options: Options<GetReelVideoData>) => queryOptions<unknown, GetReelVideoError, unknown, ReturnType<typeof getReelVideoQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getReelVideo({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getReelVideoQueryKey(options)
|
||||
});
|
||||
|
||||
export const getReelCoverQueryKey = (options: Options<GetReelCoverData>) => createQueryKey('getReelCover', options);
|
||||
|
||||
/**
|
||||
* 릴스 표지
|
||||
*/
|
||||
export const getReelCoverOptions = (options: Options<GetReelCoverData>) => queryOptions<unknown, GetReelCoverError, unknown, ReturnType<typeof getReelCoverQueryKey>>({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getReelCover({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getReelCoverQueryKey(options)
|
||||
});
|
||||
|
||||
export const healthzHealthzGetQueryKey = (options?: Options<HealthzHealthzGetData>) => createQueryKey('healthzHealthzGet', options);
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user