Skip to content

Commit ac7adb7

Browse files
committed
added click cursor and bug fixes
1 parent 45d9b75 commit ac7adb7

File tree

2 files changed

+37
-35
lines changed

2 files changed

+37
-35
lines changed

course-matrix/frontend/src/api/timetableApiSlice.ts

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,82 @@
1-
import { apiSlice } from "./baseApiSlice";
2-
import { TIMETABLES_URL } from "./config";
1+
import {apiSlice} from './baseApiSlice';
2+
import {TIMETABLES_URL} from './config';
33

44
// Endpoints for /api/timetables
55
export const timetableApiSlice = apiSlice.injectEndpoints({
66
endpoints: (builder) => ({
77
createTimetable: builder.mutation({
88
query: (data) => ({
99
url: `${TIMETABLES_URL}`,
10-
method: "POST",
10+
method: 'POST',
1111
headers: {
12-
"Content-Type": "application/json",
13-
Accept: "application/json, text/plain, */*",
12+
'Content-Type': 'application/json',
13+
Accept: 'application/json, text/plain, */*',
1414
},
1515
body: data,
16-
credentials: "include",
16+
credentials: 'include',
1717
}),
18-
invalidatesTags: ["Timetable"],
18+
invalidatesTags: ['Timetable'],
1919
}),
2020
getTimetables: builder.query<unknown, void>({
2121
query: () => ({
2222
url: `${TIMETABLES_URL}`,
23-
method: "GET",
23+
method: 'GET',
2424
headers: {
25-
"Content-Type": "application/json",
26-
Accept: "application/json, text/plain, */*",
25+
'Content-Type': 'application/json',
26+
Accept: 'application/json, text/plain, */*',
2727
},
28-
providesTags: ["Timetable"],
29-
credentials: "include",
28+
providesTags: ['Timetable'],
29+
credentials: 'include',
3030
}),
3131
keepUnusedDataFor: 0,
3232
}),
33-
getTimetable: builder.query<unknown, string | number>({
33+
getTimetable: builder.query<unknown, string|number>({
3434
query: (id) => ({
3535
url: `${TIMETABLES_URL}/${id}`,
36-
method: "GET",
36+
method: 'GET',
3737
headers: {
38-
"Content-Type": "application/json",
39-
Accept: "application/json, text/plain, */*",
38+
'Content-Type': 'application/json',
39+
Accept: 'application/json, text/plain, */*',
4040
},
41-
credentials: "include",
41+
credentials: 'include',
4242
}),
43+
keepUnusedDataFor: 0
4344
}),
4445
updateTimetable: builder.mutation({
4546
query: (data) => ({
4647
url: `${TIMETABLES_URL}/${data.id}`,
47-
method: "PUT",
48+
method: 'PUT',
4849
headers: {
49-
"Content-Type": "application/json",
50-
Accept: "application/json, text/plain, */*",
50+
'Content-Type': 'application/json',
51+
Accept: 'application/json, text/plain, */*',
5152
},
5253
body: data,
53-
credentials: "include",
54+
credentials: 'include',
5455
}),
55-
invalidatesTags: ["Timetable"],
56+
invalidatesTags: ['Timetable'],
5657
}),
5758
deleteTimetable: builder.mutation({
5859
query: (id) => ({
5960
url: `${TIMETABLES_URL}/${id}`,
60-
method: "DELETE",
61+
method: 'DELETE',
6162
headers: {
62-
"Content-Type": "application/json",
63-
Accept: "application/json, text/plain, */*",
63+
'Content-Type': 'application/json',
64+
Accept: 'application/json, text/plain, */*',
6465
},
65-
credentials: "include",
66+
credentials: 'include',
6667
}),
67-
invalidatesTags: ["Timetable"],
68+
invalidatesTags: ['Timetable'],
6869
}),
6970
generateTimetable: builder.mutation({
7071
query: (data) => ({
7172
url: `${TIMETABLES_URL}/generate`,
72-
method: "POST",
73+
method: 'POST',
7374
headers: {
74-
"Content-Type": "application/json",
75-
Accept: "application/json, text/plain, */*",
75+
'Content-Type': 'application/json',
76+
Accept: 'application/json, text/plain, */*',
7677
},
7778
body: data,
78-
credentials: "include",
79+
credentials: 'include',
7980
}),
8081
}),
8182
}),

course-matrix/frontend/src/pages/Home/TimetableCard.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,19 @@ const TimetableCard = ({
114114
onChange={(e) => setTimetableCardTitle(e.target.value)}
115115
/>
116116
</CardTitle>
117-
118117
<Star
119-
className={`w-6 h-6 transition-colors ${
118+
className={`cursor-pointer h-5 w-5 transition-colors ${
120119
toggled
121120
? "fill-yellow-500 text-yellow-500"
122121
: "fill-none text-gray-500"
123-
}`}
122+
} `}
124123
onClick={() => handleFavourite()}
125124
/>
126-
<div className="flex justify-between">
125+
126+
<div className="flex justify-around">
127127
{!isEditingTitle && (
128128
<>
129+
129130
<Button
130131
size="sm"
131132
variant="ghost"

0 commit comments

Comments
 (0)