Skip to content

Commit

Permalink
Merge pull request #3 from game-node-app/dev
Browse files Browse the repository at this point in the history
Deprecates game filter service and updates URL endponints
  • Loading branch information
Lamarcke authored Dec 8, 2024
2 parents d9ad159 + 4f199e3 commit 1d6a227
Show file tree
Hide file tree
Showing 41 changed files with 178 additions and 509 deletions.
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ NEXT_PUBLIC_DOMAIN_MAIN_WEBSITE=https://gamenode.app
NEXT_PUBLIC_SEARCH_URL=https://search.gamenode.app
NEXT_PUBLIC_SERVER_URL=https://server.gamenode.app
NEXT_PUBLIC_MATOMO_URL=https://matomo.gamenode.app/
NEXT_PUBLIC_MATOMO_SITE_ID=1
NEXT_PUBLIC_MATOMO_SITE_ID=2
NODE_ENV=production
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@mantine/modals": "^7.11.1",
"@mantine/notifications": "^7.11.1",
"@mantine/nprogress": "^7.11.1",
"@socialgouv/matomo-next": "^1.9.1",
"@tabler/icons-react": "^3.21.0",
"@tanstack/react-query": "5.18.1",
"@tanstack/react-table": "^8.19.2",
Expand Down
23 changes: 0 additions & 23 deletions src/app/(dashboard)/dashboard/game/filter/page.tsx

This file was deleted.

2 changes: 2 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import SuperTokensProvider from "@/components/auth/SuperTokensProvider";
*/
import { OpenAPI as ServerOpenAPI } from "@/wrapper/server";
import { OpenAPI as SearchOpenAPI } from "@/wrapper/search";
import MatomoWrapper from "@/components/general/MatomoWrapper";

ServerOpenAPI.BASE = process.env.NEXT_PUBLIC_SERVER_URL!;
ServerOpenAPI.WITH_CREDENTIALS = true;
Expand Down Expand Up @@ -66,6 +67,7 @@ export default function RootLayout({
<AppProvider>{children}</AppProvider>
</ModalsProvider>
<Notifications />
<MatomoWrapper />
</MantineProvider>
</DirectionProvider>
</SuperTokensProvider>
Expand Down
17 changes: 9 additions & 8 deletions src/app/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import SuperTokensProvider from "@/components/auth/SuperTokensProvider";
*/
import { OpenAPI as ServerOpenAPI } from "@/wrapper/server";
import { OpenAPI as SearchOpenAPI } from "@/wrapper/search";
import { useMatomoTracker } from "@/components/general/hooks/useMatomoTracker";

ServerOpenAPI.BASE = process.env.NEXT_PUBLIC_SERVER_URL!;
ServerOpenAPI.WITH_CREDENTIALS = true;
Expand All @@ -16,12 +17,12 @@ SearchOpenAPI.BASE = process.env.NEXT_PUBLIC_SEARCH_URL!;
const queryClient = new QueryClient();

export function AppProvider({ children }: { children: React.ReactNode }) {
return (
<SuperTokensProvider>
<QueryClientProvider client={queryClient}>
{children}
{/* <ReactQueryDevtools initialIsOpen={false} /> */}
</QueryClientProvider>
</SuperTokensProvider>
);
return (
<SuperTokensProvider>
<QueryClientProvider client={queryClient}>
{children}
{/* <ReactQueryDevtools initialIsOpen={false} /> */}
</QueryClientProvider>
</SuperTokensProvider>
);
}
10 changes: 0 additions & 10 deletions src/components/Navbar/Navbar.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,4 @@ export const navLinks: NavItem[] = [
},
],
},
{
label: "Game",
icon: IconDeviceGamepad,
links: [
{
label: "Manage exclusions",
link: "/dashboard/game/filter",
},
],
},
];
2 changes: 1 addition & 1 deletion src/components/achievement/hooks/useAchievements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function useAchievements({ offset = 0, limit = 1000 }: Props) {
return useQuery({
queryKey: ["achievements", offset, limit],
queryFn: () => {
return AchievementsService.achievementsControllerGetAchievements(
return AchievementsService.achievementsControllerGetAchievementsV1(
offset,
limit,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function useAllObtainedAchievements(
return null;
}
const achievements =
await AchievementsService.achievementsControllerGetAllObtainedAchievements(
await AchievementsService.achievementsControllerGetAllObtainedAchievementsV1(
targetUserId,
);
if (achievements == undefined || achievements.length === 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function useFeaturedObtainedAchievement(
}

const featuredAchivement =
await AchievementsService.achievementsControllerGetFeaturedAchievementForUserId(
await AchievementsService.achievementsControllerGetFeaturedAchievementForUserIdV1(
userId,
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/achievement/hooks/useObtainedAchievement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function useObtainedAchievement(
if (!achievementId) {
return null;
}
return AchievementsService.achievementsControllerGetObtainedAchievement(
return AchievementsService.achievementsControllerGetObtainedAchievementV1(
achievementId,
targetUserId,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const AchievementsGenerateCodeView = () => {
threeDaysFromNow.setDate(threeDaysFromNow.getDate() + 3);

const resp =
await AchievementsCodeService.achievementsCodeControllerGenerate(
await AchievementsCodeService.achievementsCodeControllerGenerateV1(
{
achievementId: selectedAchievementId,
expiresAt: threeDaysFromNow.toISOString(),
Expand Down
10 changes: 6 additions & 4 deletions src/components/achievement/view/AchievementsGrantView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ const AchievementsGrantView = () => {
throw new Error("At least one user must be selected.");
}

await AchievementsService.achievementsControllerGrantAchievements({
achievementId: selectedAchievementId,
targetUserIds: selectedUserIds,
});
await AchievementsService.achievementsControllerGrantAchievementsV1(
{
achievementId: selectedAchievementId,
targetUserIds: selectedUserIds,
},
);
},
onError: (err) => {
if (err instanceof ApiError) {
Expand Down
22 changes: 11 additions & 11 deletions src/components/activity/hooks/useActivities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { ActivitiesService } from "@/wrapper/server";
* @param userId
*/
export function useActivities(userId?: string) {
return useQuery({
queryKey: ["activities", "all", userId],
queryFn: async () => {
return ActivitiesService.activitiesRepositoryControllerFindLatest(
userId,
0,
9999999999,
);
},
retry: 1,
});
return useQuery({
queryKey: ["activities", "all", userId],
queryFn: async () => {
return ActivitiesService.activitiesRepositoryControllerFindLatestV1(
userId,
0,
9999999999,
);
},
retry: 1,
});
}
2 changes: 1 addition & 1 deletion src/components/activity/hooks/useInfiniteActivities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function useInfiniteActivities({
return useInfiniteQuery({
queryKey: ["activities", criteria, limit],
queryFn: async ({ pageParam }) => {
return ActivitiesFeedService.activitiesFeedControllerBuildActivitiesFeed(
return ActivitiesFeedService.activitiesFeedControllerBuildActivitiesFeedV1(
criteria,
pageParam,
limit,
Expand Down
2 changes: 1 addition & 1 deletion src/components/activity/hooks/useLatestActivities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function useLatestActivities(
return useQuery({
queryKey: ["activities", "latest", userId, offset, limit],
queryFn: async () => {
return ActivitiesService.activitiesRepositoryControllerFindLatest(
return ActivitiesService.activitiesRepositoryControllerFindLatestV1(
userId,
offset,
limit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export default function useCollectionEntriesForUserId(
return useQuery({
queryKey: ["collection-entries", "all", userId, offset, limit],
queryFn: async () => {
return CollectionsEntriesService.collectionsEntriesControllerFindAllByLibraryId(
return CollectionsEntriesService.collectionsEntriesControllerFindAllByLibraryIdV1(
userId,
{},
offset,
limit,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function useCollectionEntry(collectionEntryId: string) {
return useQuery({
queryKey: ["collection-entries", collectionEntryId],
queryFn: async () => {
return CollectionsEntriesService.collectionsEntriesControllerFindEntryById(
return CollectionsEntriesService.collectionsEntriesControllerFindEntryByIdV1(
collectionEntryId,
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ export function useFavoriteCollectionEntriesForUserId(
return useQuery({
queryKey: ["collection-entries", "favorites", userId],
queryFn: () => {
return CollectionsEntriesService.collectionsEntriesControllerFindFavoritesByLibraryId(
return CollectionsEntriesService.collectionsEntriesControllerFindFavoritesByLibraryIdV1(
userId,
{},
offset,
limit,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function getCollectionEntriesByCollectionId(
orderBy?: Record<string, any>,
): Promise<CollectionEntriesPaginatedResponseDto | undefined> {
try {
return await CollectionsEntriesService.collectionsEntriesControllerFindAllByCollectionId(
return await CollectionsEntriesService.collectionsEntriesControllerFindAllByCollectionIdV1(
collectionId,
{
offset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function getOwnCollectionEntryByGameId(
gameId: number,
): Promise<CollectionEntry | undefined> {
try {
return await CollectionsEntriesService.collectionsEntriesControllerFindOwnEntryByGameId(
return await CollectionsEntriesService.collectionsEntriesControllerFindOwnEntryByGameIdV1(
gameId,
);
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/collection/hooks/useCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function useCollection(
return null;
}

return CollectionsService.collectionsControllerFindOneByIdWithPermissions(
return CollectionsService.collectionsControllerFindOneByIdWithPermissionsV1(
collectionId,
);
},
Expand Down
Loading

0 comments on commit 1d6a227

Please sign in to comment.