refactor: Controller files and names
This commit is contained in:
parent
86d6b52a39
commit
e5e2fd7b59
@ -11,7 +11,7 @@ import {
|
||||
* Or connect multiple usecases and run them, handle their failure, hydrate and store data in
|
||||
* client state managements.
|
||||
*/
|
||||
export default function cardController(props: {
|
||||
export default function getCardIcon(props: {
|
||||
type: "invoices" | "customers" | "pending" | "collected";
|
||||
}) {
|
||||
const { type } = props;
|
@ -1,4 +1,4 @@
|
||||
import cardController from "@/app/[lang]/dashboard/controller/card.controller";
|
||||
import getCardIcon from "@/app/[lang]/dashboard/components/server/card-icon";
|
||||
|
||||
export function Card({
|
||||
title,
|
||||
@ -9,7 +9,7 @@ export function Card({
|
||||
value: number | string;
|
||||
type: "invoices" | "customers" | "pending" | "collected";
|
||||
}) {
|
||||
const { Icon } = cardController({ type });
|
||||
const { Icon } = getCardIcon({ type });
|
||||
|
||||
return (
|
||||
<div className="rounded-xl bg-gray-50 p-2 shadow-sm">
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Card } from "@/app/[lang]/dashboard/components/server/card";
|
||||
import cardsController from "@/app/[lang]/dashboard/controller/cards.controller";
|
||||
import fetchSummaryInfoController from "@/app/[lang]/dashboard/controller/fetch-summary-info.controller";
|
||||
|
||||
export default async function CardWrapper() {
|
||||
const { customersNumber, invoicesNumber, invoicesSummary } =
|
||||
await cardsController();
|
||||
await fetchSummaryInfoController();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -7,7 +7,7 @@ import { connection } from "next/server";
|
||||
* Or connect multiple usecases and run them, handle their failure, hydrate and store data in
|
||||
* client state managements.
|
||||
*/
|
||||
export default function cardsController() {
|
||||
export default function fetchSummaryInfoController() {
|
||||
connection();
|
||||
return fetchSummaryInfoUsecase();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user