Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #190

Closed
wants to merge 11 commits into from
16 changes: 16 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
on:
push:
branches: [develop]
jobs:
deploy:
name: "Deploy to netlify"
runs-on: ubuntu-latest
steps:
- name: Wait for the Netlify Preview
uses: kamranayub/[email protected]
id: waitForNetlify
with:
site_name: 'tts-fe-preview'
max_timeout: 300 # 5 minutes
env:
NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
4 changes: 4 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Layout from './components/layout'
import StorageAPI from './api/storage'
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'
import { AboutPage, TimeTableSchedulerPage, NotFoundPage, FaqsPage } from './pages'
import { getPath, config } from './utils/utils'
Expand All @@ -23,6 +24,7 @@ const redirects = [

const App = () => {
const [enabled, setEnabled] = useDarkMode()
StorageAPI.updateScrappeInfo()

return (
<BrowserRouter>
Expand Down
2 changes: 1 addition & 1 deletion src/api/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const getExtraCourses = (major: Major) => {
* Retrieves the scrappe info from the backend
*/
const getInfo = async () => {
return await apiRequest('info')
return await apiRequest('/info/')
}

const api = {
Expand Down
2 changes: 0 additions & 2 deletions src/pages/TimeTableScheduler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ export const controlCoursesGroupCheckbox = (courses: CheckedCourse[], groupCheck
}

const TimeTableSchedulerPage = () => {
StorageAPI.updateScrappeInfo()

// add check property to courses
const courseToCheckedCourse = (majorCourses: Course[][]): CheckedCourse[][] =>
majorCourses.map((year: Course[]) =>
Expand Down
Loading