diff --git a/components/core/constants/jobs.constants.ts b/components/core/constants/jobs.constants.ts
index fb09577..f6c7542 100644
--- a/components/core/constants/jobs.constants.ts
+++ b/components/core/constants/jobs.constants.ts
@@ -1,78 +1,4 @@
export const jobFilters :JobFilter[] = [
- {
- fieldName: 'job_role',
- type: 'checkbox',
- title: 'Role Type',
- icon: 'SvgoBarChart',
- list: [
- {
- label: 'Bartender',
- value: 'Bartender',
- checked: false,
- counts: 0
- },
- {
- label: 'Barback',
- value: 'Barback',
- checked: false,
- counts: 0
- },
- {
- label: 'Cook',
- value: 'Cook',
- checked: false,
- counts: 0
- },
- {
- label: 'Chef',
- value: 'Chef',
- checked: false,
- counts: 0
- },
- {
- label: 'Waiter',
- value: 'Waiter',
- checked: false,
- counts: 0
- },
- {
- label: 'Host',
- value: 'Host',
- checked: false,
- counts: 0
- },
- {
- label: 'Dishwasher',
- value: 'Dishwasher',
- checked: false,
- counts: 0
- },
- {
- label: 'Server',
- value: 'Server',
- checked: false,
- counts: 0
- },
- {
- label: 'Busser',
- value: 'Busser',
- checked: false,
- counts: 0
- },
- {
- label: 'Food Runner',
- value: 'Food Runner',
- checked: false,
- counts: 0
- },
- {
- label: 'Restaurant Manager',
- value: 'Restaurant Manager',
- checked: false,
- counts: 0
- },
- ]
- },
{
fieldName: 'experience_level',
type: 'checkbox',
diff --git a/components/pages/job-listings/JobCTA.vue b/components/pages/job-listings/JobCTA.vue
index 00e2912..073c128 100644
--- a/components/pages/job-listings/JobCTA.vue
+++ b/components/pages/job-listings/JobCTA.vue
@@ -20,10 +20,7 @@ const userType = useState('userType')
-
-
+
{{ item }}
diff --git a/components/pages/job-listings/JobPostingJSONLD.vue b/components/pages/job-listings/JobPostingJSONLD.vue
index 02a5f5b..5a0db75 100644
--- a/components/pages/job-listings/JobPostingJSONLD.vue
+++ b/components/pages/job-listings/JobPostingJSONLD.vue
@@ -3,6 +3,7 @@ const props = defineProps<{ jobData: Job }>();
function convertDateFormat(dateString: string): string {
const [monthName, day, year] = dateString.split(/,\s|\s/);
+ console.log('rr ', monthName, day, year, dateString)
const months: { [key: string]: number } = {
January: 0,
February: 1,
@@ -17,7 +18,7 @@ function convertDateFormat(dateString: string): string {
November: 10,
December: 11,
};
- const monthIndex = months[monthName];
+ const monthIndex = months[monthName.replace(',', '')];
if (monthIndex === undefined) throw new Error(`Invalid month name: ${monthName}`);
const date = new Date(Date.UTC(Number(year), monthIndex, Number(day)));
const isoDate = date.toISOString();
diff --git a/pages/blog/index.vue b/pages/blog/index.vue
index 04dbc51..6723349 100644
--- a/pages/blog/index.vue
+++ b/pages/blog/index.vue
@@ -63,7 +63,7 @@ const splitBlogs = computed(() => {
watch(() => selectedCategory.value, async (val :string) => {
showBlogsLoader.value = true;
pageInfo.value.currentPage = 1;
- await blogsStore.fetchBlogs(pageInfo.value, searchedBlog.value, val);
+ await blogsStore.fetchBlogs(pageInfo.value, searchedBlog.value, encodeURIComponent(val));
pageInfo.value.totalPages = pagination.value.pageCount;
showBlogsLoader.value = false;
})
diff --git a/pages/jobs/[id]/index.vue b/pages/jobs/[id]/index.vue
index 171175b..b97baf5 100644
--- a/pages/jobs/[id]/index.vue
+++ b/pages/jobs/[id]/index.vue
@@ -3,7 +3,6 @@ import { initModals } from 'flowbite'
import {useJobStore} from "~/segments/jobs/store";
import QuickSignUpModal from "~/components/pages/job-listings/QuickSignUpModal.vue";
import BaseSpinner from "~/components/core/BaseSpinner.vue";
-import {convertTZDateToShortDate} from "~/segments/utils";
import {defaultImageMockup} from "~/components/core/constants/common.constants";
const center = ref({ lat: 0, lng: 0 })
diff --git a/pages/jobs/index.vue b/pages/jobs/index.vue
index 13c2e41..a4280e8 100644
--- a/pages/jobs/index.vue
+++ b/pages/jobs/index.vue
@@ -25,7 +25,7 @@ const jobStore = useJobStore();
const homeStore = useHomeStore();
const { jobListings, facetCounts, totalPages, coordinates } = storeToRefs(jobStore);
-const { employmentTypesFilter, businessTypesFilter, shiftTypesFilter } = storeToRefs(homeStore);
+const { employmentTypesFilter, businessTypesFilter, shiftTypesFilter, roleTypesFilter } = storeToRefs(homeStore);
const layoutOptionSelected = ref(0);
const searchedLocationText = ref('');
@@ -46,7 +46,7 @@ const initialQuery = {
page: pageInfo.value.currentPage,
per_page: pageInfo.value.itemsPerPage,
sort_by: 'date_posted:desc',
- facet_by: 'employment_type_id,job_role,experience_level,business_type_id,shift_type_id',
+ facet_by: 'employment_type_id,job_role_id,experience_level,business_type_id,shift_type_id',
filter_by: ''
};
const query = ref(initialQuery);
@@ -101,15 +101,17 @@ async function fetchFilters() {
await Promise.all([
homeStore.fetchEmploymentTypes(),
homeStore.fetchBusinessTypes(),
- homeStore.fetchShiftTypes()
+ homeStore.fetchShiftTypes(),
+ homeStore.fetchRoleTypes()
]);
- console.log('filters ', filters.value)
if (filters.value[0].fieldName !== 'employment_type_id') // check to avoid duplicate occurrence of employment type filter
filters.value.unshift(employmentTypesFilter.value);
if (filters.value[1].fieldName !== 'business_type_id') // check to avoid duplicate occurrence of business type filter
filters.value.splice(1, 0, businessTypesFilter.value);
if (filters.value[2].fieldName !== 'shift_type_id') // check to avoid duplicate occurrence of shift type filter
filters.value.splice(2, 0, shiftTypesFilter.value);
+ if (filters.value[3].fieldName !== 'job_role_id') // check to avoid duplicate occurrence of shift type filter
+ filters.value.splice(3, 0, roleTypesFilter.value);
}
onUnmounted(() => {
diff --git a/segments/blogs/store.ts b/segments/blogs/store.ts
index b63a273..2d17c91 100644
--- a/segments/blogs/store.ts
+++ b/segments/blogs/store.ts
@@ -32,7 +32,7 @@ export const useBlogStore = defineStore('blogStore', {
} as BlogState),
actions: {
async fetchBlogs(pageInfo :PaginationInfo, queryVal :string = '', category :string = '') {
- return await getBlogsList(pageInfo.currentPage, pageInfo.itemsPerPage, queryVal, category==='View All'? '':category)
+ return await getBlogsList(pageInfo.currentPage, pageInfo.itemsPerPage, queryVal, decodeURIComponent(category) === 'View All'? '':category)
.then(({data, meta }) => {
this.$state.blogs = data;
this.$state.pagination = meta.pagination
diff --git a/segments/home/store.ts b/segments/home/store.ts
index f1ffb70..2fa717b 100644
--- a/segments/home/store.ts
+++ b/segments/home/store.ts
@@ -162,6 +162,22 @@ export const useHomeStore = defineStore('homeStore', {
icon: 'SvgoClock',
list: filterList
}
+ },
+ roleTypesFilter: (state) => {
+ const filterList = state.roleTypes
+ ?.map((role :RoleType) => ({
+ label: role.job_role,
+ value: role.job_role_id,
+ checked: false,
+ counts: 0
+ })) || []
+ return {
+ fieldName: 'job_role_id',
+ type: 'checkbox',
+ title: 'Role Type',
+ icon: 'SvgoBarChart',
+ list: filterList
+ }
}
}
})
diff --git a/segments/jobs/store.ts b/segments/jobs/store.ts
index 0788a82..32c453d 100644
--- a/segments/jobs/store.ts
+++ b/segments/jobs/store.ts
@@ -1,6 +1,6 @@
import {getJobDetails, getJobsList} from "~/segments/jobs/services";
import type {Coordinates, TypesenseQueryParam} from "~/segments/common.types";
-import {convertUnixTimestamp} from "~/components/core/constants/jobs.constants";
+import { convertRFCDateStringToLocaleDate } from "~/segments/utils";
interface JobsState {
jobsList: Job[]
@@ -52,9 +52,9 @@ export const useJobStore = defineStore('jobStore', {
if (jobDetail)
return {
...jobDetail,
- application_deadline: jobDetail?.application_deadline ? jobDetail.application_deadline.slice(0, jobDetail.application_deadline.indexOf('00:00:00')) : '',
- date_posted: jobDetail?.date_posted.slice(0, jobDetail.date_posted.indexOf('00:00:00'))
- }
+ application_deadline: jobDetail?.application_deadline ? convertRFCDateStringToLocaleDate(jobDetail.application_deadline) : '',
+ date_posted: convertRFCDateStringToLocaleDate(jobDetail?.date_posted)
+ }
else return null
},
jobFaqs: (state) :JobFaq[] => {
diff --git a/segments/utils.ts b/segments/utils.ts
index 414102a..31428c1 100644
--- a/segments/utils.ts
+++ b/segments/utils.ts
@@ -1,4 +1,4 @@
-import type { Router } from "vue-router";
+import type {Router} from "vue-router";
export const usePayloadUrl = () => {
const config = useRuntimeConfig()
@@ -29,6 +29,11 @@ export function convertTZDateToShortDate(givenDate :Date | string) {
return (date.getMonth() + 1).toString().padStart(2, '0') + '/' + date.getDate().toString().padStart(2, '0') + '/' + date.getFullYear();
}
+export function convertRFCDateStringToLocaleDate(dateString :string) {
+ const dateParts = dateString.split(' '); // converting MM, dd yyyy 00:00:00 +0000 to just MM, dd yyyy format
+ return `${dateParts[0]}, ${dateParts[1]} ${dateParts[2]}`;
+}
+
export function getDaysDifference(givenDateString :Date | string) :string {
const givenDate :any = new Date(givenDateString);
const currentDate :any = new Date();