@dytsou/intern-corner-scheduler 1.2.2 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,27 +1,31 @@
1
1
  import { API_CONFIG } from '../config';
2
2
 
3
3
  export async function generateSchedule(scheduleData) {
4
- const response = await fetch(`${API_CONFIG.BACKEND_URL}${API_CONFIG.ENDPOINTS.SCHEDULE}`, {
5
- method: 'POST',
6
- headers: {
7
- 'Content-Type': 'application/json',
8
- },
9
- body: JSON.stringify(scheduleData),
10
- });
4
+ const response = await fetch(
5
+ `${API_CONFIG.BACKEND_URL}${API_CONFIG.ENDPOINTS.SCHEDULE}`,
6
+ {
7
+ method: 'POST',
8
+ headers: {
9
+ 'Content-Type': 'application/json',
10
+ },
11
+ body: JSON.stringify(scheduleData),
12
+ }
13
+ );
11
14
 
12
- if (!response.ok) {
13
- const error = await response.json();
14
- throw new Error(error.detail || `HTTP error! status: ${response.status}`);
15
- }
15
+ if (!response.ok) {
16
+ const error = await response.json();
17
+ throw new Error(error.detail || `HTTP error! status: ${response.status}`);
18
+ }
16
19
 
17
- return await response.json();
20
+ return await response.json();
18
21
  }
19
22
 
20
23
  export async function checkHealth() {
21
- const response = await fetch(`${API_CONFIG.BACKEND_URL}${API_CONFIG.ENDPOINTS.HEALTH}`);
22
- if (!response.ok) {
23
- throw new Error('Health check failed');
24
- }
25
- return await response.json();
24
+ const response = await fetch(
25
+ `${API_CONFIG.BACKEND_URL}${API_CONFIG.ENDPOINTS.HEALTH}`
26
+ );
27
+ if (!response.ok) {
28
+ throw new Error('Health check failed');
29
+ }
30
+ return await response.json();
26
31
  }
27
-
package/vite.config.js CHANGED
@@ -1,5 +1,5 @@
1
- import { defineConfig } from 'vite'
2
- import react from '@vitejs/plugin-react'
1
+ import { defineConfig } from 'vite';
2
+ import react from '@vitejs/plugin-react';
3
3
 
4
4
  // https://vitejs.dev/config/
5
5
  export default defineConfig({
@@ -18,5 +18,4 @@ export default defineConfig({
18
18
  port: 5173,
19
19
  open: true,
20
20
  },
21
- })
22
-
21
+ });