Skip to content

Commit

Permalink
fix: group search api
Browse files Browse the repository at this point in the history
  • Loading branch information
enc2586 committed Jan 20, 2025
1 parent c593325 commit c3f020e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/api/group/search-groups-with-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export interface GroupInfo {
profileImageUrl: string | null;
}

export const serachGroupsWithName = async (groupName: string, lang: Locale) => {
export const searchGroupWithName = async (groupName: string, lang: Locale) => {
return await ziggleApi
.get<GroupInfo[]>(`/groups/search?name=${groupName}&lang=${lang}`)
.then(({ data }) => data);
.get<{ list: GroupInfo[] }>(`/group/search?query=${groupName}&lang=${lang}`)
.then(({ data: { list } }) => list);
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Image from 'next/image';
import Link from 'next/link';
import { ComponentProps, Suspense } from 'react';

import { serachGroupsWithName } from '@/api/group/search-groups-with-name';
import { searchGroupWithName } from '@/api/group/search-groups-with-name';
import { getAllNotices } from '@/api/notice/notice-server';
import Analytics from '@/app/components/shared/Analytics';
import LoadingCatAnimation from '@/app/components/shared/LoadingCatAnimation';
Expand Down Expand Up @@ -30,7 +30,7 @@ const Results = async ({
}).catch(() => ({ list: [], total: 0 }));

const groups = props.search
? await serachGroupsWithName(props.search, lng).catch(() => [])
? await searchGroupWithName(props.search, lng).catch(() => [])
: [];

return (
Expand Down

0 comments on commit c3f020e

Please sign in to comment.