Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ jobs:
run: |
ssh -o StrictHostKeyChecking=no -i pirocheck.pem \
ubuntu@${{ secrets.EC2_HOST }} \
"fuser -k 8080/tcp || true && nohup java -jar pirocheck-0.0.1-SNAPSHOT.jar > log.txt 2>&1 &"

"fuser -k 8080/tcp || true && \
cd /home/ubuntu && \
nohup java -jar pirocheck-0.0.1-SNAPSHOT.jar > log.txt 2>&1 &"

- name: Restart Spring Boot on EC2
run: |
ssh -o StrictHostKeyChecking=no -i pirocheck.pem ubuntu@${{ secrets.EC2_HOST }} 'bash ~/restart.sh'
# - name: Restart Spring Boot on EC2
# run: |
# ssh -o StrictHostKeyChecking=no -i pirocheck.pem ubuntu@${{ secrets.EC2_HOST }} 'bash ~/restart.sh'


- name: Send Discord notification (Success)
Expand Down
24 changes: 12 additions & 12 deletions frontend/src/Assignment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Header from "./components/Header";
import AssignmentInfoBlock from "./components/AssignmentInfoBlock";
import styles from "./Assignment.module.css";
import { mapStatus } from "./utils/AssignmentStatus.js";
import { fetchAssignmentsByUser } from "./api/assignment.js";

const Assignment = () => {
const [weeks, setWeeks] = useState([]);
Expand All @@ -16,18 +17,18 @@ const Assignment = () => {
if (!userId) return;

fetchAssignmentsByUser(userId)
.then((weekData) => {
const formatted = weekData.map((weekItem) => ({
label: `${weekItem.week}주차 ${weekItem.title}`,
details: weekItem.days.map((dayItem) => ({
day: dayItem.day,
subject: weekItem.title,
tasks: dayItem.details.map((task) => ({
label: task.assignmentName,
status: mapStatus(task.status),
.then((weekData) => {
const formatted = weekData.map((weekItem) => ({
label: `${weekItem.week}주차 ${weekItem.title}`,
details: weekItem.days.map((dayItem) => ({
day: dayItem.day,
subject: weekItem.title,
tasks: dayItem.details.map((task) => ({
label: task.assignmentName,
status: mapStatus(task.status),
})),
})),
})),
}));
}));

setWeeks(formatted);

Expand Down Expand Up @@ -63,4 +64,3 @@ const Assignment = () => {
};

export default Assignment;

8 changes: 5 additions & 3 deletions frontend/src/Attendance.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Header from "./components/Header";
import InputBlock from "./components/InputBlock";
import AttendanceWeekInfo from "./components/AttendanceWeekInfo";
import styles from "./Attendance.module.css";
import axios from "axios";
import api from "./api/api";

const Attendance = () => {
const [attendanceCode, setAttendanceCode] = useState([""]);
Expand Down Expand Up @@ -88,7 +88,7 @@ const Attendance = () => {
if (!userId) return;

// 유저 전체 출석 데이터 불러오기
const res = await axios.get(`/api/attendance/user`, {
const res = await api.get(`/attendance/user`, {
params: { userId },
withCredentials: true, // 세션 기반 인증 요청처리
});
Expand All @@ -108,7 +108,7 @@ const Attendance = () => {
if (!userId) return;

const today = new Date().toISOString().split("T")[0]; // YYYY-MM-DD
const res = await axios.get(`/api/attendance/user/date`, {
const res = await api.get(`/attendance/user/date`, {
params: { userId, date: today },
withCredentials: true, // 세션 기반 인증 요청처리
});
Expand Down Expand Up @@ -151,8 +151,10 @@ const Attendance = () => {
if (!userId) return;

// 유저가 입력한 출석 코드 서버에 전달(서버에서 출석코드 체크)

const res = await axios.post(
"/api/attendance/mark",

{
userId,
code: attendanceCode[0],
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/api.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from "axios";

const api = axios.create({
baseURL: "/api",
baseURL: "http://api.pirocheck.org/api",
withCredentials: true,
});

Expand Down
6 changes: 2 additions & 4 deletions frontend/src/api/assignment.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import axios from "axios";
import api from "./api";

export const fetchAssignmentsByUser = async (userId) => {
const res = await axios.get(`/api/assignment/grouped/${userId}`, {
withCredentials: true
});
const res = await api.get(`/assignment/grouped/${userId}`);
return res.data;
};
2 changes: 1 addition & 1 deletion frontend/src/api/user.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const loginUser = async ({ name, password }) => {
const res = await fetch("/api/login", {
const res = await fetch("http://api.pirocheck.org/api/login", {
method: "POST",
headers: {
"Content-Type": "application/json",
Expand Down