Skip to content

Commit

Permalink
Merge pull request #125 from GSG-G7/heroku-script
Browse files Browse the repository at this point in the history
Heroku script
  • Loading branch information
aminalakhsham authored Oct 5, 2019
2 parents f02cdba + d524934 commit e201e1f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion client/src/components/common/TeacherTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class TeacherTable extends React.Component {
first_name: firstName,
last_name: lastName,
subject_name: subjectName,
teacher_id: id,
user_id: id,
subject_id: subjectId,
class: classId,
}) => (
Expand Down
1 change: 0 additions & 1 deletion server/database/config/build.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ CREATE TABLE teacher(
bio text,
image_url text,
mobile INTEGER,
email VARCHAR(255),
interest text,
FOREIGN KEY (user_id) REFERENCES "user"(id)
);
Expand Down
10 changes: 5 additions & 5 deletions server/database/config/fakedata.sql
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ VALUES
(0127893456, 4);

INSERT INTO teacher
(first_name,last_name,user_id, bio, image_url, mobile, email, interest)
(first_name,last_name,user_id, bio, image_url, mobile, interest)
VALUES
('Ahmed','Ghareb',5, 'Hi Iam Ahmed Ghareb Iam a teacher in Gaza Primary School you can contact me', 'https://cdn4.iconfinder.com/data/icons/BRILLIANT/accounting/png/400/executive.png',0599542154,'ahm-214@gmail.com','Reading novels'),
('Ali','Taha',6, 'Hi Iam Ali Taha Iam a teacher in Gaza Primary School you can contact me', 'https://cdn4.iconfinder.com/data/icons/BRILLIANT/accounting/png/400/executive.png',0599542154,'ahm-214@gmail.com','Reading novels'),
('Arwa','Omar',7, 'Hi Iam Arwa Omar Iam a teacher in Gaza Primary School you can contact me', 'https://cdn4.iconfinder.com/data/icons/BRILLIANT/accounting/png/400/executive.png',0599542154,'ahm-214@gmail.com','Reading novels'),
('Hala','salah',8, 'Hi Iam Hala Salah Iam a teacher in Gaza Primary School you can contact me', 'https://cdn4.iconfinder.com/data/icons/BRILLIANT/accounting/png/400/executive.png',0599542154,'ahm-214@gmail.com','Reading novels');
('Ahmed','Ghareb',5, 'Hi Iam Ahmed Ghareb Iam a teacher in Gaza Primary School you can contact me', 'https://cdn4.iconfinder.com/data/icons/BRILLIANT/accounting/png/400/executive.png',0599542154,'Reading novels'),
('Ali','Taha',6, 'Hi Iam Ali Taha Iam a teacher in Gaza Primary School you can contact me', 'https://cdn4.iconfinder.com/data/icons/BRILLIANT/accounting/png/400/executive.png',0599542154,'Reading novels'),
('Arwa','Omar',7, 'Hi Iam Arwa Omar Iam a teacher in Gaza Primary School you can contact me', 'https://cdn4.iconfinder.com/data/icons/BRILLIANT/accounting/png/400/executive.png',0599542154,'Reading novels'),
('Hala','salah',8, 'Hi Iam Hala Salah Iam a teacher in Gaza Primary School you can contact me', 'https://cdn4.iconfinder.com/data/icons/BRILLIANT/accounting/png/400/executive.png',0599542154,'Reading novels');

INSERT INTO student
(student_name,class,parent_id)
Expand Down
1 change: 1 addition & 0 deletions server/database/quieres/subjectPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const subject = (id) => {
const sql = {
text: ` select
subject_teacher.teacher_id ,
teacher.user_id ,
teacher.last_name ,
teacher.first_name ,
subject_teacher.subject_id ,
Expand Down
2 changes: 1 addition & 1 deletion server/database/quieres/teacherProfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const connection = require('../config/connection');

const getTeacherProfile = (id) => connection.query(
'select first_name, last_name, bio, image_url, mobile, teacher.email, interest from teacher inner join "user" on teacher.user_id="user".id where "user".id=$1 ',
'select first_name, last_name, bio, image_url, mobile, "user".email, interest from teacher inner join "user" on teacher.user_id="user".id where teacher.user_id=$1 ',
[id],
);

Expand Down
1 change: 1 addition & 0 deletions test/routes/subjecrPage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ test('Test subject Page', (t) => {
const expected = {
teacher_id: 1,
last_name: 'Ghareb',
user_id: 5,
first_name: 'Ahmed',
subject_id: 1,
subject_name: 'English',
Expand Down

0 comments on commit e201e1f

Please sign in to comment.