add not my file button
This commit is contained in:
@@ -404,7 +404,7 @@ export async function fetchComplainInfo(id: number) {
|
||||
}
|
||||
}
|
||||
|
||||
export type MatchStatus = 'NEW' | 'SHOWED' | 'LEGAL_IN_WORK' | 'COMPLAINT_IN_WORK' | 'COMPLAINT_AND_LEGAL_IN_WORK' | 'AUTHORIZED_USE';
|
||||
export type MatchStatus = 'NEW' | 'SHOWED' | 'LEGAL_IN_WORK' | 'COMPLAINT_IN_WORK' | 'COMPLAINT_AND_LEGAL_IN_WORK' | 'AUTHORIZED_USE' | 'NOT_OWNER_FILE';
|
||||
|
||||
export async function updateMatchStatus(id: number, status: MatchStatus) {
|
||||
const token = await getSessionData('token');
|
||||
|
||||
@@ -575,6 +575,8 @@
|
||||
|
||||
&-action {
|
||||
margin-top: auto;
|
||||
display: flex;
|
||||
gap: 10px
|
||||
}
|
||||
|
||||
&-actions {
|
||||
|
||||
@@ -18,7 +18,18 @@ import { createPortal } from 'react-dom';
|
||||
import { IconContentCopy, IconFollowToLink, IconFullScreen } from '@/app/ui/icons/icons';
|
||||
import { useViewport } from '@/app/hooks/useViewport';
|
||||
|
||||
export default function FilePageViolationInfo({ selectedViolation, caseType }: { selectedViolation: ViolationFileDetail | null, caseType?: 'claim' | 'complaint' }) {
|
||||
export default function FilePageViolationInfo(
|
||||
{
|
||||
selectedViolation,
|
||||
caseType,
|
||||
callBackSelectedViolation
|
||||
}:
|
||||
{
|
||||
selectedViolation: ViolationFileDetail | null,
|
||||
caseType?: 'claim' | 'complaint',
|
||||
callBackSelectedViolation: React.Dispatch<React.SetStateAction<ViolationFileDetail | null>>,
|
||||
}
|
||||
) {
|
||||
const t = useTranslations('Global');
|
||||
const tStatus = useTranslations('Match-status');
|
||||
const queryClient = useQueryClient();
|
||||
@@ -53,6 +64,13 @@ export default function FilePageViolationInfo({ selectedViolation, caseType }: {
|
||||
}
|
||||
queryClient.invalidateQueries({ queryKey: ['fileViolations'] });
|
||||
queryClient.invalidateQueries({ queryKey: ['complainInfo', id] });
|
||||
|
||||
if (status === 'NOT_OWNER_FILE') {
|
||||
console.log('NOT_OWNER_FILE');
|
||||
setLocalViolation(null);
|
||||
callBackSelectedViolation(null);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
setLocalViolation(selectedViolation);
|
||||
@@ -311,6 +329,17 @@ export default function FilePageViolationInfo({ selectedViolation, caseType }: {
|
||||
<div
|
||||
className="violation-info-action"
|
||||
>
|
||||
<button
|
||||
className="btn-s btn-resolve"
|
||||
onClick={() => {
|
||||
if (selectedViolation?.id) {
|
||||
updateStatusHandler(selectedViolation.id, 'NOT_OWNER_FILE');
|
||||
}
|
||||
}}
|
||||
disabled={isUpdating}
|
||||
>
|
||||
{tStatus('NOT_OWNER_FILE')}
|
||||
</button>
|
||||
<button
|
||||
className="btn-s btn-resolve"
|
||||
onClick={() => {
|
||||
|
||||
@@ -220,7 +220,7 @@ export default function FilePageViolationsList({
|
||||
})}
|
||||
</div>
|
||||
{/* general info for match */}
|
||||
<FilePageViolationInfo selectedViolation={selectedViolation} caseType={caseType} />
|
||||
<FilePageViolationInfo selectedViolation={selectedViolation} caseType={caseType} callBackSelectedViolation={setSelectedViolation} />
|
||||
|
||||
</div>
|
||||
{/* pagination */}
|
||||
|
||||
Reference in New Issue
Block a user