-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(3167): enhance search, filter, and sort on private cloud pages
- Loading branch information
Showing
26 changed files
with
350 additions
and
627 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,17 @@ | ||
import { ProjectStatus } from '@prisma/client'; | ||
import _isString from 'lodash-es/isString'; | ||
import createApiHandler from '@/core/api-handler'; | ||
import { OkResponse } from '@/core/responses'; | ||
import { searchPublicCloudProducts } from '@/queries/public-cloud-products'; | ||
import { publicCloudProductSearchBodySchema } from '@/validation-schemas/public-cloud'; | ||
import searchOp from '../_operations/search'; | ||
|
||
export const POST = createApiHandler({ | ||
roles: ['user'], | ||
validations: { body: publicCloudProductSearchBodySchema }, | ||
})(async ({ session, body }) => { | ||
const { search = '', page = 1, pageSize = 5, ministry, provider, includeInactive = false, sortKey, sortOrder } = body; | ||
|
||
const data = await searchOp({ | ||
const { docs, totalCount } = await searchPublicCloudProducts({ | ||
session, | ||
search, | ||
page, | ||
pageSize, | ||
ministry, | ||
provider, | ||
status: includeInactive ? undefined : ProjectStatus.ACTIVE, | ||
sortKey: sortKey || undefined, | ||
sortOrder, | ||
...body, | ||
}); | ||
|
||
return OkResponse(data); | ||
return OkResponse({ docs, totalCount }); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,17 @@ | ||
import _isString from 'lodash-es/isString'; | ||
import createApiHandler from '@/core/api-handler'; | ||
import { OkResponse } from '@/core/responses'; | ||
import { searchPublicCloudRequests } from '@/queries/public-cloud-requests'; | ||
import { publicCloudRequestSearchBodySchema } from '@/validation-schemas/public-cloud'; | ||
import searchOp from '../_operations/search'; | ||
|
||
export const POST = createApiHandler({ | ||
roles: ['user'], | ||
validations: { body: publicCloudRequestSearchBodySchema }, | ||
})(async ({ session, body }) => { | ||
const { | ||
licencePlate = '', | ||
search = '', | ||
page = 1, | ||
pageSize = 5, | ||
ministry = '', | ||
provider = '', | ||
includeInactive = false, | ||
sortKey, | ||
sortOrder, | ||
} = body; | ||
|
||
const data = await searchOp({ | ||
licencePlate, | ||
const { docs, totalCount } = await searchPublicCloudRequests({ | ||
session, | ||
search, | ||
page, | ||
pageSize, | ||
ministry, | ||
provider, | ||
includeInactive, | ||
sortKey: sortKey || undefined, | ||
sortOrder, | ||
...body, | ||
}); | ||
|
||
return OkResponse(data); | ||
return OkResponse({ docs, totalCount }); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.