Skip to content
Open

Dev #139

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
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
echo "CACHE_MAX=${{ secrets.CACHE_MAX }}" >> .env
echo "SLACK_URL=${{ secrets.SLACK_URL }}" >> .env
echo "SLACK_MESSAGE_TEMPLETE=${{ secrets.DEV_SLACK_MESSAGE_TEMPLETE }}" >> .env
echo "HOLIDAY_SERVICE_KEY=${{ secrets.HOLIDAY_SERVICE_KEY }}" > .env

- name: Install dependencies
run: npm install
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
echo "CACHE_MAX=${{ secrets.CACHE_MAX }}" >> .env
echo "SLACK_URL=${{ secrets.SLACK_URL }}" >> .env
echo "SLACK_MESSAGE_TEMPLETE=${{ secrets.DEV_SLACK_MESSAGE_TEMPLETE }}" >> .env
echo "HOLIDAY_SERVICE_KEY=${{ secrets.HOLIDAY_SERVICE_KEY }}" > .env

- name: Install dependencies
run: npm install
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function bootstrap() {
console.log(process.env);
const app = await NestFactory.create(AppModule, { cors: true });
app.enableCors({
origin: true,
origin: ['https://futsal-kumoh.kro.kr', 'http://kumoh-futsal.kro.kr'],
exposedHeaders: ['Access_token', 'Refresh_token'],
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
credentials: true,
Expand Down
4 changes: 3 additions & 1 deletion src/reservation/reservation-slot.builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import axios from 'axios';
import dayjs, { Dayjs } from 'dayjs';

export class ReservationSlotBuilder {
private readonly ServiceKey =
process.env.HOLIDAY_SERVICE_KEY;
constructor(private nextMonth: Dayjs, private today: Dayjs) {}

async getPublicHolidays(year: number, month: number) {
const publicList: string[] = [];

try {
const url = `http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/getHoliDeInfo?ServiceKey=sPWOL4v2MOAE7sUq055%2BwdPT7voiyC2O97JQXNOnraKoP1hYApVuDOdnqZo9Q%2Bvz7olpXweaxcfSUJW1euhSGA%3D%3D&solYear=${year}&solMonth=${
const url = `http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/getHoliDeInfo?ServiceKey=${this.ServiceKey}&solYear=${year}&solMonth=${
month + 1
}`;
const response = await axios.get(url);
Expand Down