mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-08-02 19:46:40 +08:00
[offers][chore] Change location filter from city to country
This commit is contained in:
@ -55,9 +55,9 @@ export default function OffersTable({
|
||||
[
|
||||
'offers.list',
|
||||
{
|
||||
// Location: 'Singapore, Singapore', // TODO: Geolocation
|
||||
cityId: cityFilter,
|
||||
companyId: companyFilter,
|
||||
// Location: 'Singapore, Singapore', // TODO: Geolocation
|
||||
countryId: cityFilter,
|
||||
currency,
|
||||
limit: NUMBER_OF_OFFERS_IN_PAGE,
|
||||
offset: pagination.currentPage,
|
||||
|
@ -42,8 +42,8 @@ const getYoeRange = (yoeCategory: number | null | undefined) => {
|
||||
|
||||
export const offersRouter = createRouter().query('list', {
|
||||
input: z.object({
|
||||
cityId: z.string().nullish(),
|
||||
companyId: z.string().nullish(),
|
||||
countryId: z.string().nullish(),
|
||||
currency: z.string().nullish(),
|
||||
dateEnd: z.date().nullish(),
|
||||
dateStart: z.date().nullish(),
|
||||
@ -131,11 +131,15 @@ export const offersRouter = createRouter().query('list', {
|
||||
where: {
|
||||
AND: [
|
||||
{
|
||||
cityId:
|
||||
input.cityId != null && input.cityId.length !== 0
|
||||
? input.cityId
|
||||
location: {
|
||||
state: {
|
||||
countryId:
|
||||
input.countryId != null && input.countryId.length !== 0
|
||||
? input.countryId
|
||||
: undefined,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
offersIntern: {
|
||||
isNot: null,
|
||||
@ -247,11 +251,15 @@ export const offersRouter = createRouter().query('list', {
|
||||
where: {
|
||||
AND: [
|
||||
{
|
||||
cityId:
|
||||
input.cityId != null && input.cityId.length !== 0
|
||||
? input.cityId
|
||||
location: {
|
||||
state: {
|
||||
countryId:
|
||||
input.countryId != null && input.countryId.length !== 0
|
||||
? input.countryId
|
||||
: undefined,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
offersIntern: {
|
||||
is: null,
|
||||
|
Reference in New Issue
Block a user