Compare commits
No commits in common. "d10cf03f989e25b82316f1a79af7482d139e629f" and "d1e7405780fdab2a1ed7fdb374843f7be2efbe7d" have entirely different histories.
d10cf03f98
...
d1e7405780
|
|
@ -166,9 +166,10 @@ export default function ComplainsDetails({
|
||||||
|
|
||||||
const checkKey2 = (item: any) => {
|
const checkKey2 = (item: any) => {
|
||||||
const dcKey = Decrypt(item.cipherKeyInspector, selectedFile);
|
const dcKey = Decrypt(item.cipherKeyInspector, selectedFile);
|
||||||
console.log(dcKey);
|
|
||||||
if (dcKey != false && dcKey != null) {
|
if (dcKey != false && dcKey != null) {
|
||||||
if (check) {
|
if (check) {
|
||||||
|
localStorage.setItem("privatePassword", dcKey);
|
||||||
localStorage.setItem("privateKey", selectedFile);
|
localStorage.setItem("privateKey", selectedFile);
|
||||||
}
|
}
|
||||||
localStorage.setItem("trackingNumber", item.trackingNumber);
|
localStorage.setItem("trackingNumber", item.trackingNumber);
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ export default function InspectorOperations({
|
||||||
const password = useData((state) => state.data.password);
|
const password = useData((state) => state.data.password);
|
||||||
const possibleOperations = complaintData?.possibleOperationsWithDescription;
|
const possibleOperations = complaintData?.possibleOperationsWithDescription;
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const form = useForm<z.infer<typeof FormSchema>>({
|
const form = useForm<z.infer<typeof FormSchema>>({
|
||||||
resolver: zodResolver(FormSchema),
|
resolver: zodResolver(FormSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
|
|
@ -85,17 +85,10 @@ export default function InspectorOperations({
|
||||||
toast("عملیات شما با موفقیت انجام شد. ", {
|
toast("عملیات شما با موفقیت انجام شد. ", {
|
||||||
className: "!bg-green-500 !text-white",
|
className: "!bg-green-500 !text-white",
|
||||||
});
|
});
|
||||||
// const tk = localStorage.getItem("trackingNumber");
|
const tk = localStorage.getItem("trackingNumber");
|
||||||
const storedData = JSON.parse(
|
|
||||||
localStorage.getItem("CompliantData") as string
|
|
||||||
);
|
|
||||||
const dcKey = Decrypt(
|
|
||||||
storedData.cipherKeyInspector,
|
|
||||||
localStorage.getItem("privateKey") as string
|
|
||||||
);
|
|
||||||
updateData({
|
updateData({
|
||||||
trackingNumber: complaintData.trackingNumber,
|
trackingNumber: complaintData.trackingNumber,
|
||||||
password: key2 ? key2 : dcKey,
|
password: key2 ? key2 : (localStorage.getItem("privateKey") as string),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onError: (err: any | string) => {
|
onError: (err: any | string) => {
|
||||||
|
|
@ -108,11 +101,8 @@ export default function InspectorOperations({
|
||||||
function onSubmit(data: z.infer<typeof FormSchema>) {
|
function onSubmit(data: z.infer<typeof FormSchema>) {
|
||||||
const storedData = JSON.parse(
|
const storedData = JSON.parse(
|
||||||
localStorage.getItem("CompliantData") as string
|
localStorage.getItem("CompliantData") as string
|
||||||
);
|
);
|
||||||
const dcKey = Decrypt(
|
const dcKey = Decrypt(storedData.cipherKeyInspector, key2);
|
||||||
storedData.cipherKeyInspector,
|
|
||||||
localStorage.getItem("privateKey") as string
|
|
||||||
);
|
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("text", data.text);
|
formData.append("text", data.text);
|
||||||
formData.append("trackingNumber", complaintData.trackingNumber);
|
formData.append("trackingNumber", complaintData.trackingNumber);
|
||||||
|
|
@ -120,7 +110,10 @@ export default function InspectorOperations({
|
||||||
if (data.type) {
|
if (data.type) {
|
||||||
formData.append("IsPublic", data.type == "public" ? "true" : "false");
|
formData.append("IsPublic", data.type == "public" ? "true" : "false");
|
||||||
}
|
}
|
||||||
formData.append("EncodedKey", key2 ? key2 : dcKey);
|
formData.append(
|
||||||
|
"EncodedKey",
|
||||||
|
key2 ? key2 : (localStorage.getItem("privateKey") as string)
|
||||||
|
);
|
||||||
if (data?.media && data?.media?.length > 0) {
|
if (data?.media && data?.media?.length > 0) {
|
||||||
for (let i = 0; i < data.media.length; i++) {
|
for (let i = 0; i < data.media.length; i++) {
|
||||||
formData.append("Medias", data.media[i]);
|
formData.append("Medias", data.media[i]);
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "sootzani",
|
"name": "sootzani",
|
||||||
"version": "0.2.7",
|
"version": "0.2.6",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "sootzani",
|
"name": "sootzani",
|
||||||
"version": "0.2.7",
|
"version": "0.2.6",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hookform/resolvers": "^3.3.2",
|
"@hookform/resolvers": "^3.3.2",
|
||||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "sootzani",
|
"name": "sootzani",
|
||||||
"version": "0.2.7",
|
"version": "0.2.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,6 @@ export async function RefreshToken(payload: { token: any; refreshToken: any }) {
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
deleteCookie("Sootzani_Token");
|
deleteCookie("Sootzani_Token");
|
||||||
deleteCookie("Sootzani_Refresh_Token");
|
deleteCookie("Sootzani_Refresh_Token");
|
||||||
localStorage.removeItem("privateKey");
|
|
||||||
window.location.href = "/";
|
window.location.href = "/";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue