Also generate docs with new sataset functions
This commit is contained in:
parent
532909d0d4
commit
2fda3e3410
3 changed files with 18 additions and 11 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { EducationType } from "@/education/education.types";
|
||||
import { DocumentBuilder } from "@nestjs/swagger";
|
||||
import { RedocOptions } from "@juicyllama/nestjs-redoc";
|
||||
import { getEducationData } from "@/education/getEducationData";
|
||||
import educationDataset from "@/education/education.dataset";
|
||||
|
||||
const formatEducation = (education: EducationType) => {
|
||||
const period = `${formatDate(education.startDate)} - ${
|
||||
|
|
@ -50,10 +50,13 @@ export const addEducation = (
|
|||
redocOptions.tagGroups.push(educationTagGroup);
|
||||
}
|
||||
|
||||
getEducationData.slice(0, count).forEach((education) => {
|
||||
educationTagGroup.tags.push(education.institute);
|
||||
document.addTag(education.institute, formatEducation(education));
|
||||
});
|
||||
educationDataset
|
||||
.getData()
|
||||
.slice(0, count)
|
||||
.forEach((education) => {
|
||||
educationTagGroup.tags.push(education.institute);
|
||||
document.addTag(education.institute, formatEducation(education));
|
||||
});
|
||||
|
||||
educationTagGroup.tags.push("Education");
|
||||
document.addTag("Education", "For my complete education, take a look at the GetEducation API endpoint.");
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ExperienceType } from "@/experiences/experiences.types";
|
||||
import { DocumentBuilder } from "@nestjs/swagger";
|
||||
import { RedocOptions } from "@juicyllama/nestjs-redoc";
|
||||
import { experiencesDataset } from "@/experiences/experiences.dataset";
|
||||
import experiencesDataset from "@/experiences/experiences.dataset";
|
||||
|
||||
const formatExperience = (experience: ExperienceType) => {
|
||||
const workPeriod = `${formatDate(experience.startDate)} - ${
|
||||
|
|
@ -50,10 +50,13 @@ export const addExperiences = (
|
|||
redocOptions.tagGroups.push(experienceTagGroup);
|
||||
}
|
||||
|
||||
experiencesDataset.slice(0, count).forEach((experience) => {
|
||||
experienceTagGroup.tags.push(experience.name);
|
||||
document.addTag(experience.name, formatExperience(experience));
|
||||
});
|
||||
experiencesDataset
|
||||
.getData()
|
||||
.slice(0, count)
|
||||
.forEach((experience) => {
|
||||
experienceTagGroup.tags.push(experience.name);
|
||||
document.addTag(experience.name, formatExperience(experience));
|
||||
});
|
||||
|
||||
experienceTagGroup.tags.push("Experience");
|
||||
document.addTag(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { DocumentBuilder } from "@nestjs/swagger";
|
||||
import { RedocOptions } from "@juicyllama/nestjs-redoc";
|
||||
import { skillsDataset } from "@/skills/skills.dataset";
|
||||
import skillsDataset from "@/skills/skills.dataset";
|
||||
|
||||
export const addSkills = (
|
||||
document: DocumentBuilder,
|
||||
|
|
@ -19,6 +19,7 @@ export const addSkills = (
|
|||
|
||||
const intro = "A short excerpt of my skills are";
|
||||
const skillList = skillsDataset
|
||||
.getData()
|
||||
.slice(0, count)
|
||||
.reduce((list, skill) => list.concat(`<li><strong>${skill.name}</strong> ${skill.description}</li>`), "");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue