I am currently managing 2 API's referred to as teachers
and sessions
.
The contents of the teachers
JSON file are:
[
{
"teacherName": "Binky Alderwick",
"id": "01"
},
{
"teacherName": "Basilio Gregg",
"id": "02"
},
{
"teacherName": "Binky Alderwick",
"id": "03"
},
{
"teacherName": "Cole Moxom",
"id": "04"
}
]
The sessions
JSON file looks like this:
[
{
"id":"001",
"sessionName": "Chemistry",
"notes": "Chemistry is the study of matter, its properties",
"teacherId": "01"<==========
},
{
"id":"002",
"sessionName": "Physics",
"notes": "Physics is the natural science that studies matter and its motion ",
"teacherId": "03"
},
{
"id":"003",
"sessionName": "Maths",
"notes": "Mathematics includes the study of such topics as quantity",
"teacherId": "01"<=========
},
{
"id":"004",
"sessionName": "Biology",
"notes": "Biology is the natural science that studies life and living organisms",
"teacherId": "04"
}
]
My goal is to showcase all the teachers in the template as shown in this:
https://i.sstatic.net/oH02B.png
Within the sessions JSON, the teacherID is mentioned. I aim to display the sessions
specifically associated with the particular teacher based on their teachersID
.
For example, since the sessions (Chemistry & Maths) have a teacherID of (01), I intend to display these 2 sessions (Chemistry & Maths) under Teacher 1 (Binky Alderwick) like so:
https://i.sstatic.net/1kzZx.png
I need to retrieve all the properties of the session
object based on the teacherId
.