Kaynağa Gözat

Remove Staff type and use StaffResult

tags/Baseline_30082024_FRONTEND_UAT
Wayne 1 yıl önce
ebeveyn
işleme
9d61a46092
9 değiştirilmiş dosya ile 6 ekleme ve 22 silme
  1. +0
    -1
      src/app/(main)/staff/create/page.tsx
  2. +1
    -11
      src/app/api/staff/index.ts
  3. +0
    -1
      src/components/CreateCustomer/CreateCustomer.tsx
  4. +0
    -1
      src/components/CreateDepartment/CreateDepartment.tsx
  5. +0
    -1
      src/components/CreateDepartment/DepartmentDetails.tsx
  6. +0
    -1
      src/components/CreatePosition/CreatePosition.tsx
  7. +0
    -1
      src/components/CreatePosition/PositionDetails.tsx
  8. +2
    -2
      src/components/CreateProject/CreateProject.tsx
  9. +3
    -3
      src/components/CreateProject/ProjectClientDetails.tsx

+ 0
- 1
src/app/(main)/staff/create/page.tsx Dosyayı Görüntüle

@@ -25,7 +25,6 @@ import {
import { CreateProjectInputs, saveProject } from "@/app/api/projects/actions";
import { Error } from "@mui/icons-material";
import { ProjectCategory } from "@/app/api/projects";
import { Staff } from "@/app/api/staff";
import { Grid, Typography } from "@mui/material";
import CreateStaffForm from "@/components/CreateStaff/CreateStaffForm";



+ 1
- 11
src/app/api/staff/index.ts Dosyayı Görüntüle

@@ -3,15 +3,6 @@ import { BASE_API_URL } from "@/config/api";
import { cache } from "react";
import "server-only";

export interface Staff {
id: number;
name: string;
staffId: string;
team: {
name: string;
code: string;
};
}
export interface StaffResult {
id: number;
name: string;
@@ -31,11 +22,10 @@ export interface searchInput {

export const preloadTeamLeads = () => {
fetchTeamLeads();
// fetchStaff();
};

export const fetchTeamLeads = cache(async () => {
return serverFetchJson<Staff[]>(`${BASE_API_URL}/staffs/teamLeads`, {
return serverFetchJson<StaffResult[]>(`${BASE_API_URL}/staffs/teamLeads`, {
next: { tags: ["teamLeads"] },
});
});


+ 0
- 1
src/components/CreateCustomer/CreateCustomer.tsx Dosyayı Görüntüle

@@ -20,7 +20,6 @@ import {
import { CreateProjectInputs, saveProject } from "@/app/api/projects/actions";
import { Error } from "@mui/icons-material";
import { ProjectCategory } from "@/app/api/projects";
import { Staff } from "@/app/api/staff";
import { Typography } from "@mui/material";
import { CustomerFormInputs, saveCustomer } from "@/app/api/customer/actions";
import CustomerDetails from "./CustomerDetails";


+ 0
- 1
src/components/CreateDepartment/CreateDepartment.tsx Dosyayı Görüntüle

@@ -20,7 +20,6 @@ import {
import { CreateDepartmentInputs, saveDepartment } from "@/app/api/departments/actions";
import { Error } from "@mui/icons-material";
import { ProjectCategory } from "@/app/api/projects";
import { Staff } from "@/app/api/staff";
import { Typography } from "@mui/material";
import DepartmentDetails from "./DepartmentDetails";



+ 0
- 1
src/components/CreateDepartment/DepartmentDetails.tsx Dosyayı Görüntüle

@@ -17,7 +17,6 @@ import RestartAlt from "@mui/icons-material/RestartAlt";
import Button from "@mui/material/Button";
import { Controller, useFormContext } from "react-hook-form";
import { CreateDepartmentInputs } from "@/app/api/departments/actions";
import { Staff } from "@/app/api/staff";

const DepartmentDetails: React.FC = ({
}) => {


+ 0
- 1
src/components/CreatePosition/CreatePosition.tsx Dosyayı Görüntüle

@@ -20,7 +20,6 @@ import {
import { CreatePositionInputs, savePosition } from "@/app/api/positions/actions";
import { Error } from "@mui/icons-material";
import { ProjectCategory } from "@/app/api/projects";
import { Staff } from "@/app/api/staff";
import { Typography } from "@mui/material";
import PositionDetails from "./PositionDetails";



+ 0
- 1
src/components/CreatePosition/PositionDetails.tsx Dosyayı Görüntüle

@@ -17,7 +17,6 @@ import RestartAlt from "@mui/icons-material/RestartAlt";
import Button from "@mui/material/Button";
import { Controller, useFormContext } from "react-hook-form";
import { CreatePositionInputs } from "@/app/api/positions/actions";
import { Staff } from "@/app/api/staff";

const PositionDetails: React.FC = ({
}) => {


+ 2
- 2
src/components/CreateProject/CreateProject.tsx Dosyayı Görüntüle

@@ -24,14 +24,14 @@ import {
import { CreateProjectInputs, saveProject } from "@/app/api/projects/actions";
import { Error } from "@mui/icons-material";
import { ProjectCategory } from "@/app/api/projects";
import { Staff } from "@/app/api/staff";
import { StaffResult } from "@/app/api/staff";
import { Typography } from "@mui/material";

export interface Props {
allTasks: Task[];
projectCategories: ProjectCategory[];
taskTemplates: TaskTemplate[];
teamLeads: Staff[];
teamLeads: StaffResult[];
}

const hasErrorsInTab = (


+ 3
- 3
src/components/CreateProject/ProjectClientDetails.tsx Dosyayı Görüntüle

@@ -18,12 +18,12 @@ import Button from "@mui/material/Button";
import { Controller, useFormContext } from "react-hook-form";
import { CreateProjectInputs } from "@/app/api/projects/actions";
import { ProjectCategory } from "@/app/api/projects";
import { Staff } from "@/app/api/staff";
import { StaffResult } from "@/app/api/staff";

interface Props {
isActive: boolean;
projectCategories: ProjectCategory[];
teamLeads: Staff[];
teamLeads: StaffResult[];
}

const ProjectClientDetails: React.FC<Props> = ({
@@ -99,7 +99,7 @@ const ProjectClientDetails: React.FC<Props> = ({
<Select label={t("Team Lead")} {...field}>
{teamLeads.map((staff, index) => (
<MenuItem key={`${staff.id}-${index}`} value={staff.id}>
{`${staff.staffId} - ${staff.name} (${staff.team.code})`}
{`${staff.staffId} - ${staff.name} (${staff.team})`}
</MenuItem>
))}
</Select>


Yükleniyor…
İptal
Kaydet