From 249f000671a98779ba8bb8cf59c26884a4b022a3 Mon Sep 17 00:00:00 2001
From: "M. Reza Qorib" <rezaqorib96@gmail.com>
Date: Tue, 28 Mar 2017 14:38:32 +0700
Subject: [PATCH] [#140654507] #13 change Lowongan component to use real api
 format

---
 assets/js/components/Lowongan.jsx    | 22 +++++++++-------------
 assets/js/components/VacancyList.jsx |  3 +--
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/assets/js/components/Lowongan.jsx b/assets/js/components/Lowongan.jsx
index 2998b80a..76ebdb82 100644
--- a/assets/js/components/Lowongan.jsx
+++ b/assets/js/components/Lowongan.jsx
@@ -2,32 +2,28 @@ import React from 'react';
 import { Button, Image as ImageComponent, Item, Rating } from 'semantic-ui-react'
 import ModalPendaftaran from './ModalPendaftaran';
 
+const defaultImage = "http://semantic-ui.com/images/wireframe/image.png";
 
- const paragraph = <ImageComponent src="http://semantic-ui.com/images/wireframe/short-paragraph.png" />;
-const image = <Item.Image size="small" src="http://semantic-ui.com/images/wireframe/image.png" />;
 export default class Lowongan extends React.Component {
   static propTypes = {
     data: React.PropTypes.object.isRequired,
   };
 
   render() {
+    console.log(this.props.data);
+    console.log(this.props.data.company);
     return (
 
         <Item >
-          {image}
+          <Item.Image size="small" src={this.props.data.company.logo ? this.props.data.company.logo: defaultImage} />
           <Item.Content verticalAlign="middle">
-            <Item.Header>{this.props.header}</Item.Header>
-            <Item.Description>{this.props.content}</Item.Description>
             <Item.Extra>
+                <h3>{ this.props.data.name }</h3>
+                <h4>{ this.props.data.company.name }</h4>
+                <h5>{ this.props.data.company.address }</h5>
 
-                <h3>{ this.props.data.data1 }</h3>
-                <h4>PT. Koding Kuat </h4>
-                <h5> JL.Kali deres utara no.1 </h5>
-                <h5> Jakarta Barat, DKI Jakarta</h5>
-
-                <ModalPendaftaran id={1} data={ { header: 'Deskripsi Lowongan', description: 'Lorem ipsum dolor sit amet, consectetur' +
-                ' adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim ' +
-                'veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.' } } buttonTitle="Daftar"  />
+                <ModalPendaftaran id={this.props.data.id} data={{ header: this.props.data.name,
+                  description: this.props.data.description }} buttonTitle="Daftar" />
 
             </Item.Extra>
           </Item.Content>
diff --git a/assets/js/components/VacancyList.jsx b/assets/js/components/VacancyList.jsx
index 044af11e..cae3def6 100644
--- a/assets/js/components/VacancyList.jsx
+++ b/assets/js/components/VacancyList.jsx
@@ -12,8 +12,7 @@ export default class VacancyList extends React.Component {
   constructor(props) {
     super(props);
     this.state = { vacancies: [] };
-    console.log(Server.isLoggedIn());
-    Server.get(this.props.url).then((data) => {
+    Server.get(this.props.url, false).then((data) => {
       console.log(data);
       this.setState({ vacancies: data });
     }, () => {
-- 
GitLab