Skip to content

Commit

Permalink
feat: dashboar | total routes at dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
MRoyhanF committed Dec 23, 2024
1 parent 923a9fa commit ae2c585
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/modules/dashboard/dashboard.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const index = async (req, res, next) => {
const airplanes = await axios.get(`${api}/api/v1/airplanes`);
const flights = await axios.get(`${api}/api/v1/flights`);
const tickets = await axios.get(`${api}/api/v1/tickets`);
const routes = await axios.get(`${api}/api/v1/routes`);
const users = await axios.get(`${api}/api/v1/users`, {
headers: {
Authorization: `Bearer ${token}`,
Expand All @@ -24,6 +25,7 @@ export const index = async (req, res, next) => {
totalAirplanes : airplanes.data.data.length,
totalFlights : flights.data.data.length,
totalTickets : tickets.data.data.length,
totalRoutes : routes.data.data.length,
totalUsers : users.data.data.length,
}

Expand Down
2 changes: 1 addition & 1 deletion src/resources/views/pages/dashboard/index.edge
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</div>
<div class="w-2/6 flex flex-col justify-center items-center bg-white rounded-lg p-4">
<div class="text-2xl font-bold w-full text-center border-b-2 border-gray-300">Total Route</div>
<div class="text-2xl font-bold w-full text-center">{{ totalData.totalAirlines }}</div>
<div class="text-2xl font-bold w-full text-center">{{ totalData.totalRoutes }}</div>
</div>
</div>

Expand Down

0 comments on commit ae2c585

Please sign in to comment.