Skip to content

Commit

Permalink
Merge branch 'Thang' of github.com:AnataAria/Fall2023SWP391_NET1703_G…
Browse files Browse the repository at this point in the history
…roup1 into vinh
  • Loading branch information
AnataAria committed Nov 16, 2023
2 parents 70061e5 + cdf8a2c commit ac05090
Show file tree
Hide file tree
Showing 6 changed files with 312 additions and 142 deletions.
15 changes: 15 additions & 0 deletions frontend/my-app/src/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
import { type } from "os";
export type MonthlyData = {
year?: number | null;
firstMonth: number;
secondMonth: number;
thirdMonth: number;
fourthMonth: number;
fifthMonth: number;
sixthMonth: number;
seventhMonth: number;
eighthMonth: number;
ninthMonth: number;
tenthMonth: number;
eleventhMonth: number;
twelfthMonth: number;
}
export type InstructorInfo = {
id: number;
fullName: string;
Expand Down
8 changes: 6 additions & 2 deletions frontend/my-app/src/routes/CourseCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
export let isFetchManual: boolean;
import { Card, Rating, Badge } from "flowbite-svelte";
let open = true;
let tmpRating: number;
let counter = 6;
let message = "";
let errorMsg = "";
Expand Down Expand Up @@ -91,7 +92,10 @@
await axios
.get(apiBaseUrl + `review/rating?courseID=${id}`)
.then((response) => {
if (response.status === 200) rating = response.data;
if (response.status === 200){
tmpRating = response.data;
rating = parseFloat(tmpRating.toFixed(1));
}
});
}
let status = false;
Expand Down Expand Up @@ -146,7 +150,7 @@
</h5>
</a>
<Rating {rating} class="mt-2.5 mb-5">
<Badge slot="text" class="ml-3">{rating.toFixed(1)}</Badge>
<Badge slot="text" class="ml-3">{rating}</Badge>
</Rating>
<div class="flex justify-between items-center">
<span class="text-3xl font-bold text-gray-900 dark:text-white"
Expand Down
4 changes: 3 additions & 1 deletion frontend/my-app/src/routes/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@
<NavHamburger />
</div>
<NavUl>
{#if jwtData.role == "CUSTOMER"}
{#if jwtData.role === "CUSTOMER"}
<NavLi href="/mylearning">My Learning</NavLi>
<NavLi href="/cart">Your Cart</NavLi>
{:else if jwtData.role === "STAFF"}
<NavLi href="/staff/revenuestatistics">Staff Management Dashboard</NavLi>
{:else}
<NavLi href="/teaching">Assign Instructor</NavLi>
{/if}
Expand Down
Loading

0 comments on commit ac05090

Please sign in to comment.