Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
오원석 authored and 오원석 committed Dec 27, 2023
1 parent 4591fc2 commit fa4852f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions layouts/seminar/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<div id="seminar-container"></div>

<script>
const api_url = 'http://salbox.korea.ac.kr/seminar/api/'

function format() {
var args = Array.prototype.slice.call (arguments, 1);
return arguments[0].replace (/\{(\d+)\}/g, function (match, index) {
Expand Down Expand Up @@ -44,21 +46,21 @@
* Get the posts lists in json format.
*/
const getSchedules = async () => {
let response = await fetch('http://localhost:8000/api/schedule/')
let response = await fetch(api_url + "schedule/")
let data = await response.json()
// console.log(data)
return data
}

const getSeminars = async (schedule_id) => {
let response = await fetch(format('http://localhost:8000/api/seminar/?scheduled_at={0}', schedule_id))
let response = await fetch(format(api_url + '?scheduled_at={0}', schedule_id))
let data = await response.json()
// console.log(data)
return data
}

const getMember = async (member_id) => {
let response = await fetch(format('http://localhost:8000/api/member/{0}', member_id))
let response = await fetch(format(api_url + '/member/{0}', member_id))
let data = await response.json()
// console.log(data)
return data
Expand Down

0 comments on commit fa4852f

Please sign in to comment.