chore: new estimates workflow (#927)

* chore: new services for estimates

* chore: new estimates workflow
This commit is contained in:
Aaryan Khandelwal 2023-04-22 00:59:57 +05:30 committed by GitHub
parent cb814dd68b
commit c638b6aba6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 349 additions and 587 deletions

View file

@ -6,6 +6,7 @@ import useSWR, { mutate } from "swr";
// services
import estimatesService from "services/estimates.service";
import projectService from "services/project.service";
// hooks
import useProjectDetails from "hooks/use-project-details";
// layouts
@ -24,7 +25,6 @@ import { IEstimate, IProject } from "types";
import type { NextPage } from "next";
// fetch-keys
import { ESTIMATES_LIST, PROJECT_DETAILS } from "constants/fetch-keys";
import projectService from "services/project.service";
const EstimatesSettings: NextPage = () => {
const [estimateFormOpen, setEstimateFormOpen] = useState(false);
@ -61,13 +61,6 @@ const EstimatesSettings: NextPage = () => {
estimatesService
.deleteEstimate(workspaceSlug as string, projectId as string, estimateId)
.then(() => {
setToastAlert({
type: "success",
title: "Success!",
message: "Estimate Deleted successfully.",
});
})
.catch(() => {
setToastAlert({
type: "error",
@ -127,7 +120,7 @@ const EstimatesSettings: NextPage = () => {
<div className="col-span-12 space-y-5 sm:col-span-7">
<div className="flex items-center gap-2">
<span
className="flex items-center cursor-pointer gap-2 text-theme"
className="flex cursor-pointer items-center gap-2 text-theme"
onClick={() => {
setEstimateToUpdate(undefined);
setEstimateFormOpen(true);
@ -143,7 +136,7 @@ const EstimatesSettings: NextPage = () => {
</div>
</section>
{estimatesList && estimatesList.length > 0 && (
<section className="mt-4 divide-y px-6 mb-8 rounded-xl border bg-white">
<section className="mt-4 mb-8 divide-y divide-brand-base rounded-xl border border-brand-base bg-brand-base px-6">
<>
{estimatesList ? (
estimatesList.map((estimate) => (