Skip to content

Commit

Permalink
add link to job detail
Browse files Browse the repository at this point in the history
  • Loading branch information
cbleek committed Dec 15, 2021
1 parent 57cd172 commit c238f9f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 40 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ The form is .env-aware.
| YAWIK_URL_PRIVACY | Link to the Privacy notes |
| YAWIK_APP_KEY | Shared App Key |
| YAWIK_API_URL | Yawik API |
| YAWIK_JOB_URL | URL to job details |
| YAWIK_ROUTER_BASE | Router Base of the web app |
| YAWIK_SSO_URL | Keycloak base URL |
| YAWIK_SSO_REALM | Keycloak realm |
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Wizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default
},
onSave()
{
fetch(process.env.YAWIK_STRAPI_URL + '/api/jobs', {
fetch(process.env.YAWIK_API_URL + '/api/jobs', {
method: 'POST',
headers: {
accept: 'application/json',
Expand Down
53 changes: 14 additions & 39 deletions src/pages/jobs/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
{{ props.row.attributes.publishedAt }}
</q-td>
<q-td key="title" :props="props">
<span class="cursor-pointer jobtitle" @click="getJob(props.row)">
{{ props.row.attributes.jobTitle }}
</span>
<a target="_new" :href="jobDetailUrl + props.row.attributes.html.data?.attributes?.url">
<span class="cursor-pointer jobtitle">
{{ props.row.attributes.jobTitle }}
</span>
</a>
</q-td>
<q-td key="location" :props="props">
{{ props.row.attributes.formattedAddress }}
Expand All @@ -34,18 +36,15 @@
</q-tr>
</template>
</q-table>
<job-preview :model-value="modelValue" :job="job" @closed="modelValue=false" />
</q-page>
</template>

<script>
import JobPreview from './JobPreview';
import { useMeta } from 'quasar';
export default {
name: 'Index',
components: { JobPreview },
setup()
{
useMeta({
Expand All @@ -62,17 +61,16 @@ export default {
return {
rows: [],
jobsUrl: `${process.env.YAWIK_API_URL}/api/jobs`,
jobDetailUrl: `${process.env.YAWIK_JOB_URL}`,
loading: false,
rowsPerPageOptions: [10, 25, 50, 100, 500],
pagination: {
sortBy: 'asc',
sortBy: 'desc',
descending: true,
rowsNumber: 10,
page: 1,
rowsPerPage: 10
},
modelValue: false,
job: null
};
},
computed:
Expand Down Expand Up @@ -126,9 +124,13 @@ export default {
getJobs(pagination = { pagination: this.pagination })
{
this.loading = true;
this.$axios.get(this.jobsUrl +
'?pagination[page]=' + pagination.pagination.page +
'&pagination[pageSize]=' + pagination.pagination.rowsPerPage
this.$axios.get(this.jobsUrl, {
params: {
'pagination[page]': pagination.pagination.page,
'pagination[pageSize]': pagination.pagination.rowsPerPage,
populate: 'html'
}
}
).then(response =>
{
this.rows = response.data.data;
Expand All @@ -148,33 +150,6 @@ export default {
rowsPerPage: pagination.pageSize
};
},
getJob(job)
{
// this.$axios.get(`http://localhost:1337/api/jobs/1`,
this.$axios.get(`${process.env.YAWIK_API_URL}/api/jobs/${job.id}`,
{
headers: {
accept: 'application/json',
Authorization: 'Bearer ' + this.$store.getters.GET_TOKEN.token,
'Content-Type': 'application/json',
}
}).then(response =>
{
this.job = response.data.data.attributes;
this.modelValue = true;
});
},
viewJob(job)
{
/*this.$router.push(
{
name: 'job',
params: {
id: job.id
}
});*/
},
}
};
</script>
Expand Down

0 comments on commit c238f9f

Please sign in to comment.