diff --git a/src/actions/education/schools/read.ts b/src/actions/education/schools/read.ts index a87e22ecf..72ae3ba3d 100644 --- a/src/actions/education/schools/read.ts +++ b/src/actions/education/schools/read.ts @@ -3,7 +3,7 @@ import { createActionError } from '@/actions/error' import { safeServerCall } from '@/actions/safeServerCall' import { readSchool, readSchools, readSchoolsPage, readStandardSchools } from '@/services/education/schools/read' import { getUser } from '@/auth/getUser' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { ActionReturn } from '@/actions/Types' import type { ExpandedSchool, SchoolCursor, SchoolFiltered } from '@/education/schools/Types' diff --git a/src/actions/images/collections/read.ts b/src/actions/images/collections/read.ts index 2b3f1d735..a9404774c 100644 --- a/src/actions/images/collections/read.ts +++ b/src/actions/images/collections/read.ts @@ -12,7 +12,7 @@ import { includeVisibility } from '@/services/visibility/read' import { checkVisibility } from '@/auth/checkVisibility' import { SpecialCollection } from '@prisma/client' import type { VisibilityCollapsed } from '@/services/visibility/Types' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { ImageCollection } from '@prisma/client' import type { ExpandedImageCollection, diff --git a/src/actions/images/read.ts b/src/actions/images/read.ts index 3df75399e..6c65701db 100644 --- a/src/actions/images/read.ts +++ b/src/actions/images/read.ts @@ -5,7 +5,7 @@ import { readImage, readImagesPage, readSpecialImage } from '@/services/images/r import { createBadImage } from '@/services/images/create' import { SpecialImage } from '@prisma/client' import type { Image } from '@prisma/client' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { ActionReturn } from '@/actions/Types' import type { ImageDetails, ImageCursor } from '@/services/images/Types' diff --git a/src/actions/lockers/read.ts b/src/actions/lockers/read.ts index 83a03a1c6..a9b205f03 100644 --- a/src/actions/lockers/read.ts +++ b/src/actions/lockers/read.ts @@ -4,7 +4,7 @@ import { createActionError } from '@/actions/error' import { readLocker, readLockerPage, updateLockerReservationIfExpired } from '@/services/lockers/read' import { getUser } from '@/auth/getUser' import type { ActionReturn } from '@/actions/Types' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { LockerWithReservation, LockerCursor } from '@/services/lockers/Types' /** diff --git a/src/actions/news/read.ts b/src/actions/news/read.ts index bae5b7a11..761b994a6 100644 --- a/src/actions/news/read.ts +++ b/src/actions/news/read.ts @@ -3,7 +3,7 @@ import { safeServerCall } from '@/actions/safeServerCall' import { readNews, readNewsCurrent, readOldNewsPage } from '@/services/news/read' import type { ExpandedNewsArticle, NewsCursor, SimpleNewsArticle } from '@/services/news/Types' import type { ActionReturn } from '@/actions/Types' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' export async function readOldNewsPageAction( readPageImput: ReadPageInput diff --git a/src/actions/omegaquotes/read.ts b/src/actions/omegaquotes/read.ts index 337be31e8..384fefb07 100644 --- a/src/actions/omegaquotes/read.ts +++ b/src/actions/omegaquotes/read.ts @@ -4,7 +4,7 @@ import { createActionError } from '@/actions/error' import { getUser } from '@/auth/getUser' import { readQuotesPage } from '@/services/omegaquotes/read' import type { ActionReturn } from '@/actions/Types' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { OmegaquoteCursor, OmegaquoteFiltered } from '@/services/omegaquotes/Types' export async function readQuotesPageAction( diff --git a/src/actions/users/read.ts b/src/actions/users/read.ts index 3054845b1..b0f3aed1e 100644 --- a/src/actions/users/read.ts +++ b/src/actions/users/read.ts @@ -9,7 +9,7 @@ import { User } from '@/services/users' import type { ExpandedGroup } from '@/services/groups/Types' import type { UserDetails, UserCursor, UserPagingReturn, Profile } from '@/services/users/Types' import type { ActionReturn } from '@/actions/Types' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { Permission } from '@prisma/client' /** diff --git a/src/contexts/paging/CompanyPaging.tsx b/src/contexts/paging/CompanyPaging.tsx index 56c2a8039..5be8f2846 100644 --- a/src/contexts/paging/CompanyPaging.tsx +++ b/src/contexts/paging/CompanyPaging.tsx @@ -2,7 +2,7 @@ import generatePagingProvider, { generatePagingContext } from './PagingGenerator' import { readCompanyPageAction } from '@/actions/career/companies/read' import type { CompanyCursor, CompanyDetails, CompanyExpanded } from '@/services/career/companies/Types' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' export type PageSizeCompany = 10 const fetcher = async (x: ReadPageInput) => { diff --git a/src/contexts/paging/DotPaging.tsx b/src/contexts/paging/DotPaging.tsx index efc380f5b..caf40a204 100644 --- a/src/contexts/paging/DotPaging.tsx +++ b/src/contexts/paging/DotPaging.tsx @@ -1,7 +1,7 @@ 'use client' import generatePagingProvider, { generatePagingContext } from './PagingGenerator' import { readDotPage } from '@/actions/dots/read' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { DotDetails, DotCursor, DotWrapperWithDots } from '@/services/dots/Types' export type PageSizeDots = 30 diff --git a/src/contexts/paging/EventArchivePaging.tsx b/src/contexts/paging/EventArchivePaging.tsx index 59bd9ea29..ed7087191 100644 --- a/src/contexts/paging/EventArchivePaging.tsx +++ b/src/contexts/paging/EventArchivePaging.tsx @@ -2,7 +2,7 @@ import generatePagingProvider, { generatePagingContext } from './PagingGenerator' import { readArchivedEventsPage } from '@/actions/events/read' import type { EventArchiveCursor, EventArchiveDetails, EventExpanded } from '@/services/events/Types' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' export type PageSizeEventArchive = 12 const fetcher = async (x: ReadPageInput) => { diff --git a/src/contexts/paging/ImageCollectionPaging.tsx b/src/contexts/paging/ImageCollectionPaging.tsx index b56228dcd..10fbd2432 100644 --- a/src/contexts/paging/ImageCollectionPaging.tsx +++ b/src/contexts/paging/ImageCollectionPaging.tsx @@ -1,7 +1,7 @@ 'use client' import generatePagingProvider, { generatePagingContext } from './PagingGenerator' import { readImageCollectionsPageAction } from '@/actions/images/collections/read' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { ImageCollectionCursor, ImageCollectionPageReturn } from '@/services/images/collections/Types' export type PageSizeImageCollection = 12 diff --git a/src/contexts/paging/ImagePaging.tsx b/src/contexts/paging/ImagePaging.tsx index 904a5ac27..c535c521a 100644 --- a/src/contexts/paging/ImagePaging.tsx +++ b/src/contexts/paging/ImagePaging.tsx @@ -1,7 +1,7 @@ 'use client' import generatePagingProvider, { generatePagingContext } from './PagingGenerator' import { readImagesPageAction } from '@/actions/images/read' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { Image } from '@prisma/client' import type { ImageCursor, ImageDetails } from '@/services/images/Types' diff --git a/src/contexts/paging/JobAdInactivePaging.tsx b/src/contexts/paging/JobAdInactivePaging.tsx index 7b76ebf17..61fc1f0d6 100644 --- a/src/contexts/paging/JobAdInactivePaging.tsx +++ b/src/contexts/paging/JobAdInactivePaging.tsx @@ -1,7 +1,7 @@ 'use client' import generatePagingProvider, { generatePagingContext } from './PagingGenerator' import { readInactiveJobAdsPageAction } from '@/actions/career/jobAds/read' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { JobAdInactiveCursor, JobAdInactiveDetails, SimpleJobAd } from '@/services/career/jobAds/Types' export type PageSizeJobAdInactive = 12 diff --git a/src/contexts/paging/LockerPaging.tsx b/src/contexts/paging/LockerPaging.tsx index d0e7e7a71..906072774 100644 --- a/src/contexts/paging/LockerPaging.tsx +++ b/src/contexts/paging/LockerPaging.tsx @@ -1,7 +1,7 @@ 'use client' import generatePagingProvider, { generatePagingContext } from '@/contexts/paging/PagingGenerator' import { readLockerPageAction } from '@/actions/lockers/read' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { LockerCursor, LockerWithReservation } from '@/services/lockers/Types' export type PageSizeLocker = 20 diff --git a/src/contexts/paging/OldNewsPaging.tsx b/src/contexts/paging/OldNewsPaging.tsx index 4363c5416..668cf3fa6 100644 --- a/src/contexts/paging/OldNewsPaging.tsx +++ b/src/contexts/paging/OldNewsPaging.tsx @@ -1,7 +1,7 @@ 'use client' import generatePagingProvider, { generatePagingContext } from './PagingGenerator' import { readOldNewsPageAction } from '@/actions/news/read' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { NewsCursor, SimpleNewsArticle } from '@/services/news/Types' export type PageSizeOldNews = 20 diff --git a/src/contexts/paging/OmegaquotesPaging.tsx b/src/contexts/paging/OmegaquotesPaging.tsx index 2d547bce6..78b665618 100644 --- a/src/contexts/paging/OmegaquotesPaging.tsx +++ b/src/contexts/paging/OmegaquotesPaging.tsx @@ -1,7 +1,7 @@ 'use client' import generatePagingProvider, { generatePagingContext } from '@/contexts/paging/PagingGenerator' import { readQuotesPageAction } from '@/actions/omegaquotes/read' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { OmegaquoteCursor, OmegaquoteFiltered } from '@/services/omegaquotes/Types' export type PageSizeOmegaquote = 20; diff --git a/src/contexts/paging/PagingGenerator.tsx b/src/contexts/paging/PagingGenerator.tsx index e1af33488..e356910c4 100644 --- a/src/contexts/paging/PagingGenerator.tsx +++ b/src/contexts/paging/PagingGenerator.tsx @@ -2,7 +2,7 @@ import React, { createContext, useState, useRef, useEffect } from 'react' import type { ActionReturn } from '@/actions/Types' -import type { ReadPageInput, Page } from '@/services/paging/Types' +import type { ReadPageInput, Page } from '@/lib/paging/Types' import type { Context as ReactContextType } from 'react' export type StateTypes = { diff --git a/src/contexts/paging/SchoolPaging.tsx b/src/contexts/paging/SchoolPaging.tsx index 4649fefb1..083e62ce4 100644 --- a/src/contexts/paging/SchoolPaging.tsx +++ b/src/contexts/paging/SchoolPaging.tsx @@ -1,7 +1,7 @@ 'use client' import generatePagingProvider, { generatePagingContext } from './PagingGenerator' import { readSchoolsPageAction } from '@/education/schools/read' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { ExpandedSchool, SchoolCursor } from '@/education/schools/Types' export type PageSizeSchool = 8 diff --git a/src/contexts/paging/UserPaging.tsx b/src/contexts/paging/UserPaging.tsx index fac11ab62..dc8a2796c 100644 --- a/src/contexts/paging/UserPaging.tsx +++ b/src/contexts/paging/UserPaging.tsx @@ -1,7 +1,7 @@ 'use client' import generatePagingProvider, { generatePagingContext } from './PagingGenerator' import { readUserPageAction } from '@/actions/users/read' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { UserDetails, UserPagingReturn, UserCursor } from '@/services/users/Types' export type PageSizeUsers = 50; diff --git a/src/services/paging/Types.ts b/src/lib/paging/Types.ts similarity index 100% rename from src/services/paging/Types.ts rename to src/lib/paging/Types.ts diff --git a/src/services/paging/cursorPageingSelection.ts b/src/lib/paging/cursorPageingSelection.ts similarity index 92% rename from src/services/paging/cursorPageingSelection.ts rename to src/lib/paging/cursorPageingSelection.ts index 7bf344465..cfa5f0363 100644 --- a/src/services/paging/cursorPageingSelection.ts +++ b/src/lib/paging/cursorPageingSelection.ts @@ -1,5 +1,5 @@ import 'server-only' -import type { Page } from '@/services/paging/Types' +import type { Page } from '@/lib/paging/Types' /** * A function to generate the cursor-paging selection for a given page diff --git a/src/services/career/companies/read.ts b/src/services/career/companies/read.ts index 6538f9173..47d0a0599 100644 --- a/src/services/career/companies/read.ts +++ b/src/services/career/companies/read.ts @@ -1,8 +1,8 @@ import 'server-only' import { CompanyRelationIncluder } from './ConfigVars' import { ServiceMethodHandler } from '@/services/ServiceMethodHandler' -import { cursorPageingSelection } from '@/services/paging/cursorPageingSelection' -import type { ReadPageInput } from '@/services/paging/Types' +import { cursorPageingSelection } from '@/lib/paging/cursorPageingSelection' +import type { ReadPageInput } from '@/lib/paging/Types' import type { CompanyCursor, CompanyDetails, CompanyExpanded } from './Types' export const readPage = ServiceMethodHandler({ diff --git a/src/services/career/jobAds/read.ts b/src/services/career/jobAds/read.ts index 859639d53..4067d9d2a 100644 --- a/src/services/career/jobAds/read.ts +++ b/src/services/career/jobAds/read.ts @@ -3,9 +3,9 @@ import { jobAdArticleRealtionsIncluder, simpleJobAdArticleRealtionsIncluder } fr import { CompanyRelationIncluder } from '@/career/companies/ConfigVars' import { ServerError } from '@/services/error' import { ServiceMethodHandler } from '@/services/ServiceMethodHandler' -import { cursorPageingSelection } from '@/services/paging/cursorPageingSelection' +import { cursorPageingSelection } from '@/lib/paging/cursorPageingSelection' import type { ExpandedJobAd, JobAdInactiveCursor, JobAdInactiveDetails, SimpleJobAd } from './Types' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' /** * This handler reads a jobAd by id or articleName and order diff --git a/src/services/dots/read.ts b/src/services/dots/read.ts index d358b7650..aa0f04825 100644 --- a/src/services/dots/read.ts +++ b/src/services/dots/read.ts @@ -1,8 +1,8 @@ import 'server-only' import { DotWrapperWithDotsIncluder } from './ConfigVars' import { ServiceMethodHandler } from '@/services/ServiceMethodHandler' -import { cursorPageingSelection } from '@/services/paging/cursorPageingSelection' -import type { ReadPageInput } from '@/services/paging/Types' +import { cursorPageingSelection } from '@/lib/paging/cursorPageingSelection' +import type { ReadPageInput } from '@/lib/paging/Types' import type { DotCursor, DotDetails } from './Types' /** diff --git a/src/services/education/schools/read.ts b/src/services/education/schools/read.ts index b3ce8c5d8..6fe40f269 100644 --- a/src/services/education/schools/read.ts +++ b/src/services/education/schools/read.ts @@ -4,10 +4,10 @@ import { SchoolFilteredSelection, SchoolRelationIncluder } from './ConfigVars' import { prismaCall } from '@/services/prismaCall' import logger from '@/lib/logger' import prisma from '@/prisma' -import { cursorPageingSelection } from '@/services/paging/cursorPageingSelection' +import { cursorPageingSelection } from '@/lib/paging/cursorPageingSelection' import { StandardSchool } from '@prisma/client' import type { ExpandedSchool, SchoolCursor, SchoolFiltered } from './Types' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' export async function readSchoolsPage({ page, diff --git a/src/services/events/read.ts b/src/services/events/read.ts index 9c6ee62c5..747d05b27 100644 --- a/src/services/events/read.ts +++ b/src/services/events/read.ts @@ -1,9 +1,9 @@ import 'server-only' import { eventFilterSeletion } from './ConfigVars' import { ServiceMethodHandler } from '@/services/ServiceMethodHandler' -import { cursorPageingSelection } from '@/services/paging/cursorPageingSelection' +import { cursorPageingSelection } from '@/lib/paging/cursorPageingSelection' import { getOsloTime } from '@/lib/dates/getOsloTime' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { EventArchiveCursor, EventArchiveDetails } from './Types' export const read = ServiceMethodHandler({ diff --git a/src/services/images/collections/read.ts b/src/services/images/collections/read.ts index 9124c728e..910a97866 100644 --- a/src/services/images/collections/read.ts +++ b/src/services/images/collections/read.ts @@ -6,7 +6,7 @@ import logger from '@/lib/logger' import { prismaCall } from '@/services/prismaCall' import { ServerError } from '@/services/error' import { readSpecialVisibility } from '@/services/visibility/read' -import { cursorPageingSelection } from '@/services/paging/cursorPageingSelection' +import { cursorPageingSelection } from '@/lib/paging/cursorPageingSelection' import type { SpecialCollection, ImageCollection, Image } from '@prisma/client' import type { ExpandedImageCollection, @@ -14,7 +14,7 @@ import type { ImageCollectionPageReturn } from '@/services/images/collections/Types' import type { VisibilityFilter } from '@/auth/getVisibilityFilter' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' /** diff --git a/src/services/images/read.ts b/src/services/images/read.ts index 96fc3c77a..cab13428b 100644 --- a/src/services/images/read.ts +++ b/src/services/images/read.ts @@ -1,9 +1,9 @@ import 'server-only' -import { cursorPageingSelection } from '@/services/paging/cursorPageingSelection' +import { cursorPageingSelection } from '@/lib/paging/cursorPageingSelection' import { prismaCall } from '@/services/prismaCall' import { ServerError } from '@/services/error' import prisma from '@/prisma' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { ImageDetails, ImageCursor } from '@/services/images/Types' import type { Image, SpecialImage } from '@prisma/client' diff --git a/src/services/lockers/read.ts b/src/services/lockers/read.ts index d2437d6db..006a1df9f 100644 --- a/src/services/lockers/read.ts +++ b/src/services/lockers/read.ts @@ -3,7 +3,7 @@ import { lockerReservationIncluder } from './reservations/ConfigVars' import prisma from '@/prisma' import { ServerError } from '@/services/error' import { prismaCall } from '@/services/prismaCall' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { LockerWithReservation, LockerCursor } from '@/services/lockers/Types' export async function readLocker(id: number) { diff --git a/src/services/news/read.ts b/src/services/news/read.ts index c6c430968..158c9b852 100644 --- a/src/services/news/read.ts +++ b/src/services/news/read.ts @@ -1,11 +1,11 @@ import 'server-only' -import { cursorPageingSelection } from '@/services/paging/cursorPageingSelection' +import { cursorPageingSelection } from '@/lib/paging/cursorPageingSelection' import { prismaCall } from '@/services/prismaCall' import { ServerError } from '@/services/error' import { newsArticleRealtionsIncluder, simpleNewsArticleRealtionsIncluder } from '@/services/news/ConfigVars' import prisma from '@/prisma' import type { ExpandedNewsArticle, NewsCursor, SimpleNewsArticle } from '@/services/news/Types' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' export async function readOldNewsPage( { page }: ReadPageInput diff --git a/src/services/omegaquotes/read.ts b/src/services/omegaquotes/read.ts index 60072d116..50b9d2775 100644 --- a/src/services/omegaquotes/read.ts +++ b/src/services/omegaquotes/read.ts @@ -1,9 +1,9 @@ import 'server-only' import { omegaQuoteFilterSelection } from './CofigVars' -import { cursorPageingSelection } from '@/services/paging/cursorPageingSelection' +import { cursorPageingSelection } from '@/lib/paging/cursorPageingSelection' import { prismaCall } from '@/services/prismaCall' import prisma from '@/prisma' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { OmegaquoteCursor, OmegaquoteFiltered } from '@/services/omegaquotes/Types' export async function readQuotesPage( diff --git a/src/services/users/read.ts b/src/services/users/read.ts index fc417df66..0994d9e76 100644 --- a/src/services/users/read.ts +++ b/src/services/users/read.ts @@ -5,11 +5,11 @@ import { ServerError } from '@/services/error' import { prismaCall } from '@/services/prismaCall' import { getMembershipFilter } from '@/auth/getMembershipFilter' import { readMembershipsOfUser } from '@/services/groups/memberships/read' -import { cursorPageingSelection } from '@/services/paging/cursorPageingSelection' +import { cursorPageingSelection } from '@/lib/paging/cursorPageingSelection' import prisma from '@/prisma' import { readPermissionsOfUser } from '@/services/permissionRoles/read' import type { UserDetails, UserCursor, Profile, UserPagingReturn } from './Types' -import type { ReadPageInput } from '@/services/paging/Types' +import type { ReadPageInput } from '@/lib/paging/Types' import type { User } from '@prisma/client' /**