diff --git a/src/app/projects/projects.service.ts b/src/app/projects/projects.service.ts index 384962d..a0e5e72 100644 --- a/src/app/projects/projects.service.ts +++ b/src/app/projects/projects.service.ts @@ -32,13 +32,13 @@ export class ProjectsService { * I am actively avoiding any kind of environment management, this is a very basic site and currently this is the only api call. */ - private PROJECT_API_URL = "https://cms.inkletblot.com/" + private PROJECT_API_URL = "https://cms.inkletblot.com/api/json" constructor(private http: HttpClient) { } httpOptions = { headers: new HttpHeaders({ - 'Content-Type': 'application/json' + 'Content-Type': 'text/plain' }) }; @@ -48,7 +48,16 @@ export class ProjectsService { .subscribe( (response: Project[]) => { if (response) { - this.allProjects = response; + // using text/plain so as to not get the preflight options request + // as such : Project[] does not work as expected and objects must be parsed. + for (let project of response) { + this.allProjects.push({ + title : project.title, + description : project.description, + ct : project.ct, + body : project.body + }); + } // filter out different categories here currently only one } },