Compare commits
4 Commits
20ee4d6957
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d5fe5a977 | |||
| e4ff4d5ae9 | |||
| 982a03bf7e | |||
| bcd9318170 |
@@ -2,7 +2,7 @@
|
||||
"a address": "an address",
|
||||
"a email": "an email address",
|
||||
"a end date": "an end date",
|
||||
"a fistname": "a first name",
|
||||
"a firstname": "a first name",
|
||||
"a form": "a contract form",
|
||||
"a lastname": "a last name",
|
||||
"a name": "a name",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"a address": "une adresse",
|
||||
"a email": "une adresse email",
|
||||
"a end date": "une date de fin",
|
||||
"a fistname": "un prénom",
|
||||
"a firstname": "un prénom",
|
||||
"a form": "un formulaire de contrat",
|
||||
"a lastname": "un nom",
|
||||
"a name": "un nom",
|
||||
|
||||
@@ -4,7 +4,7 @@ import { IconDownload, IconX } from "@tabler/icons-react";
|
||||
import { t } from "@/config/i18n";
|
||||
import { useGetContractFile } from "@/services/api";
|
||||
import { useCallback } from "react";
|
||||
import { useNavigate } from "react-router";
|
||||
import { useNavigate, useSearchParams } from "react-router";
|
||||
|
||||
export type ContractRowProps = {
|
||||
contract: Contract;
|
||||
@@ -13,6 +13,7 @@ export type ContractRowProps = {
|
||||
export default function ContractRow({ contract }: ContractRowProps) {
|
||||
const getContractMutation = useGetContractFile();
|
||||
const navigate = useNavigate();
|
||||
const [searchParams] = useSearchParams();
|
||||
|
||||
const handleDownload = useCallback(async () => {
|
||||
getContractMutation.mutateAsync(contract.id);
|
||||
@@ -55,7 +56,9 @@ export default function ContractRow({ contract }: ContractRowProps) {
|
||||
mr="5"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
navigate(`/dashboard/contracts/${contract.id}/delete`);
|
||||
navigate(
|
||||
`/dashboard/contracts/${contract.id}/delete${searchParams ? `?${searchParams.toString()}` : ""}`,
|
||||
);
|
||||
}}
|
||||
>
|
||||
<IconX />
|
||||
|
||||
@@ -9,7 +9,7 @@ import { IconHome, IconLogin, IconLogout, IconSettings } from "@tabler/icons-rea
|
||||
|
||||
export function Navbar() {
|
||||
const { loggedUser: user, isLoading } = useAuth();
|
||||
const isPhone = useMediaQuery("(max-width: 760px");
|
||||
const isPhone = useMediaQuery("(max-width: 760px)");
|
||||
|
||||
if (!user && isLoading) {
|
||||
return (
|
||||
|
||||
@@ -87,7 +87,7 @@ export function useGetShipment(
|
||||
options?: Partial<DefinedInitialDataOptions<Shipment, Error, Shipment, readonly unknown[]>>,
|
||||
): UseQueryResult<Shipment, Error> {
|
||||
return useQuery<Shipment>({
|
||||
queryKey: ["shipment"],
|
||||
queryKey: ["shipment", id],
|
||||
queryFn: () =>
|
||||
fetchWithAuth(`${Config.backend_uri}/shipments/${id}`, {
|
||||
credentials: "include",
|
||||
@@ -322,7 +322,7 @@ export function useGetForm(
|
||||
options?: Partial<DefinedInitialDataOptions<Form, Error, Form, readonly unknown[]>>,
|
||||
) {
|
||||
return useQuery<Form>({
|
||||
queryKey: ["form"],
|
||||
queryKey: ["form", id],
|
||||
queryFn: () =>
|
||||
fetchWithAuth(`${Config.backend_uri}/forms/${id}`, {
|
||||
credentials: "include",
|
||||
@@ -456,7 +456,7 @@ export function useGetProduct(
|
||||
options?: Partial<DefinedInitialDataOptions<Product, Error, Product, readonly unknown[]>>,
|
||||
) {
|
||||
return useQuery<Product>({
|
||||
queryKey: ["product"],
|
||||
queryKey: ["product", id],
|
||||
queryFn: () =>
|
||||
fetchWithAuth(`${Config.backend_uri}/products/${id}`, {
|
||||
credentials: "include",
|
||||
@@ -579,7 +579,7 @@ export function useGetUser(
|
||||
options?: Partial<DefinedInitialDataOptions<User, Error, User, readonly unknown[]>>,
|
||||
) {
|
||||
return useQuery<User>({
|
||||
queryKey: ["user"],
|
||||
queryKey: ["user", id],
|
||||
queryFn: () =>
|
||||
fetchWithAuth(`${Config.backend_uri}/users/${id}`, {
|
||||
credentials: "include",
|
||||
@@ -712,7 +712,7 @@ export function useGetContract(
|
||||
options?: Partial<DefinedInitialDataOptions<Contract, Error, Contract, readonly unknown[]>>,
|
||||
) {
|
||||
return useQuery<Contract>({
|
||||
queryKey: ["contract"],
|
||||
queryKey: ["contract", id],
|
||||
queryFn: () =>
|
||||
fetchWithAuth(`${Config.backend_uri}/contracts/${id}`, {
|
||||
credentials: "include",
|
||||
|
||||
Reference in New Issue
Block a user