Skip to content

Commit

Permalink
fix :: eslint warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ftery0 committed Nov 9, 2024
1 parent 4694fbb commit 696005a
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 63 deletions.
67 changes: 38 additions & 29 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,48 @@
name: Trigger Web Deploy

on:
push:
push:
branches:
- master

pull_request:
branches:
- master
name: Production Deployment

jobs:
deploy:
name: Deploy
trigger-deploy:
runs-on: ubuntu-latest
steps:
- name: ๐Ÿšš Get latest code
uses: actions/checkout@v2

- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-
${{ runner.OS }}-
env:
PR_TITLE: ${{ github.event.pull_request.title || '' }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message || '' }}
FINAL_TITLE: ${{ github.event.pull_request.title || github.event.head_commit.message }}

- name: ๐Ÿงฉ Install Modules
run: yarn
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: ๐Ÿ‘ทโ€โ™‚๏ธ Build Project
run: yarn build
env:
CI: false
- name: Clean Commit Message
id: clean-message
run: |
CLEAN_TITLE=$(echo "${{ env.FINAL_TITLE }}" | tr -d '\000-\031')
echo "CLEAN_TITLE=$CLEAN_TITLE" >> $GITHUB_ENV
- name: ๐Ÿ“‚ Sync files
uses: SamKirkland/[email protected]
- name: Trigger Deploy
uses: peter-evans/repository-dispatch@v2
with:
server: ${{ secrets.DODAM_FILEZILLA_IP }}
username: ${{ secrets.DODAM_FILEZILLA_USERNAME }}
password: ${{ secrets.DODAM_FILEZILLA_PWD }}
local-dir: ./build/
port: 2021
protocol: ftps
token: ${{ secrets.GIT_ACCESS_TOKEN }}
repository: team-b1nd/web-deploy-config
event-type: trigger-deploy
client-payload: |
{
"repo_name": "${{ github.repository }}",
"branch": "${{ github.ref }}",
"source_directory": "./build",
"project_name": "dodam",
"destination_directory": "/schedule",
"config_secret": "${{ secrets.CONFIG_JSON }}",
"title": "${{ env.CLEAN_TITLE }}",
"package_manager_config_command": "npm config set registry=https://npm.pkg.github.com/Team-B1ND && npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GIT_ACCESS_TOKEN }} && npm config set //registry.npmjs.org/:_authToken=${{ secrets.GIT_ACCESS_TOKEN }}",
"package_manager": "npm"
}
43 changes: 23 additions & 20 deletions src/hooks/schedule/useHomeSidebarSchedule.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dayjs from "dayjs";
import { useEffect, useState } from "react";
import { useEffect, useState, useCallback } from "react";
import { useRecoilValue } from "recoil";
import { useGetMember } from "../../queries/member/member.query";
import { useGetSchedulesByDate } from "../../queries/schedule/schedule.query";
Expand All @@ -20,43 +20,46 @@ const useHomeSidebarSchedule = () => {
{ suspense: true },
);

const loadMyGradeSchedules = () => {
const loadMyGradeSchedules = useCallback(() => {
setSchedules(
schedulesData?.data.filter(
(schedule) =>
schedule.targetGrades[0].indexOf(String(memberData?.data.student.grade)) > -1 ||
schedule.targetGrades[0] === "์ „๊ต์ƒ",
)!,
);
};
}, [schedulesData, memberData]);

const loadAllSchedules = () => {
const loadAllSchedules = useCallback(() => {
setSchedules(schedulesData!.data);
};
}, [schedulesData]);

const handleSchedules = (scope: string) => {
setSchedules([]);
const handleSchedules = useCallback(
(scope: string) => {
setSchedules([]);

switch (scope) {
case "์ „์ฒด ์ผ์ •":
loadAllSchedules();
break;
switch (scope) {
case "์ „์ฒด ์ผ์ •":
loadAllSchedules();
break;

case "๋‚ด ์ผ์ •":
loadMyGradeSchedules();
break;
case "๋‚ด ์ผ์ •":
loadMyGradeSchedules();
break;

default:
loadAllSchedules();
break;
}
};
default:
loadAllSchedules();
break;
}
},
[loadAllSchedules, loadMyGradeSchedules]
);

useEffect(() => {
if (schedulesData?.data) {
handleSchedules(classificationKeyword);
}
}, [schedulesData?.data, classificationKeyword]);
}, [schedulesData?.data, classificationKeyword, handleSchedules]);

return {
schedules,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/cookie/cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ class Cookie {
cookie.remove(key);
}
}

export default new Cookie();
const cookies = new Cookie();
export default cookies;
4 changes: 2 additions & 2 deletions src/lib/token/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class Token {
cookie.removeCookie(REFRESH_TOKEN_KEY);
}
}

export default new Token();
const token = new Token();
export default token;
4 changes: 2 additions & 2 deletions src/repository/member/member.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ class MemberRepository {
return data;
}
}

export default new MemberRepository();
const memberRepository = new MemberRepository();
export default memberRepository;
4 changes: 2 additions & 2 deletions src/repository/schedule/schedule.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ class ScheduleRepository {
return data;
}
}

export default new ScheduleRepository();
const scheduleRepository = new ScheduleRepository();
export default scheduleRepository;
4 changes: 2 additions & 2 deletions src/repository/token/token.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ class Token {
return data;
}
}

export default new Token();
const token = new Token();
export default token;
4 changes: 2 additions & 2 deletions src/util/transform/dataTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ class DataTransform {

}
}

export default new DataTransform();
const dataTransform = new DataTransform();
export default dataTransform;
4 changes: 2 additions & 2 deletions src/util/transform/dateTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ class DateTransform {
return dayjs(date).format("YYYY-MM-DD HH:mm");
}
}

export default new DateTransform();
const dateTransform = new DateTransform();
export default dateTransform;

0 comments on commit 696005a

Please sign in to comment.