fix: button in filter regional, load in create video
This commit is contained in:
parent
0757ec6519
commit
f5802ff248
|
|
@ -582,7 +582,6 @@ export default function FormVideo() {
|
|||
|
||||
console.log("📝 Deskripsi final yang dikirim:", finalDescription);
|
||||
|
||||
|
||||
let requestData: {
|
||||
title: string;
|
||||
description: string;
|
||||
|
|
@ -650,7 +649,16 @@ export default function FormVideo() {
|
|||
setIsStartUpload(true);
|
||||
setProgressList(progressInfoArr);
|
||||
|
||||
close();
|
||||
MySwal.fire({
|
||||
title: "Mengunggah Video...",
|
||||
text: "Mohon tunggu hingga proses upload selesai.",
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
},
|
||||
});
|
||||
// close();
|
||||
// showProgress();
|
||||
files.map(async (item: any, index: number) => {
|
||||
await uploadResumableFile(index, String(id), item, "0");
|
||||
|
|
@ -763,19 +771,28 @@ export default function FormVideo() {
|
|||
counter++;
|
||||
}
|
||||
}
|
||||
if (counter == progressInfo.length) {
|
||||
if (counter === progressInfo.length) {
|
||||
setIsStartUpload(false);
|
||||
// hideProgress();
|
||||
Cookies.remove("idCreate");
|
||||
|
||||
close();
|
||||
|
||||
successSubmit("/in/contributor/content/video");
|
||||
}
|
||||
|
||||
// if (counter == progressInfo.length) {
|
||||
// setIsStartUpload(false);
|
||||
// // hideProgress();
|
||||
// Cookies.remove("idCreate");
|
||||
// successSubmit("/in/contributor/content/video");
|
||||
// }
|
||||
}
|
||||
|
||||
const handleImageChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const file = e.target.files?.[0];
|
||||
if (file) {
|
||||
setThumbnail(file); // Simpan file asli tanpa dimodifikasi
|
||||
setPreview(URL.createObjectURL(file)); // Simpan preview string terpisah
|
||||
setThumbnail(file);
|
||||
setPreview(URL.createObjectURL(file));
|
||||
console.log("Selected Thumbnail:", file);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -305,18 +305,18 @@ export default function FilterAudioComponent(props: {
|
|||
</Carousel>
|
||||
<div className="flex justify-center mt-1 mb-6">
|
||||
<Link
|
||||
// href={
|
||||
// `${
|
||||
// asPath.includes("/polda/")
|
||||
// ? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
// : ""
|
||||
// }/audio/` +
|
||||
// `${group ? "regional?" : "filter?"}` +
|
||||
// `sortBy=${sortBy === "popular" ? "popular" : "latest"}` +
|
||||
// `${title ? `&title=${title.toLowerCase()}` : ""}` +
|
||||
// `${categorie ? `&category=${categorie}` : ""}`
|
||||
// }
|
||||
href={isRegional ? `/regional/all-polda/audio/all` : href}
|
||||
href={
|
||||
`${
|
||||
asPath.includes("/polda/")
|
||||
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
: ""
|
||||
}/audio/` +
|
||||
`${group ? "regional?" : "filter?"}` +
|
||||
`sortBy=${sortBy === "popular" ? "popular" : "latest"}` +
|
||||
`${title ? `&title=${title.toLowerCase()}` : ""}` +
|
||||
`${categorie ? `&category=${categorie}` : ""}`
|
||||
}
|
||||
// href={isRegional ? `/regional/all-polda/audio/all` : href}
|
||||
className="border border-red-500 text-red-500 hover:bg-red-500 hover:text-white transition-colors duration-200 px-4 py-2 rounded-md text-sm"
|
||||
>
|
||||
Lihat Semua
|
||||
|
|
|
|||
|
|
@ -288,7 +288,19 @@ export default function FilterDocumentComponent(props: {
|
|||
// categorie ? `&category=${categorie}` : ""
|
||||
// }${group ? `&group=${group}` : ""}`}
|
||||
|
||||
href={isRegional ? `/regional/all-polda/document/all` : href}
|
||||
href={
|
||||
`${
|
||||
asPath.includes("/polda/")
|
||||
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
: ""
|
||||
}/document/` +
|
||||
`${group ? "regional?" : "filter?"}` +
|
||||
`sortBy=${sortBy === "popular" ? "popular" : "latest"}` +
|
||||
`${title ? `&title=${title.toLowerCase()}` : ""}` +
|
||||
`${categorie ? `&category=${categorie}` : ""}`
|
||||
}
|
||||
|
||||
// href={isRegional ? `/regional/all-polda/document/all` : href}
|
||||
className="border border-red-500 text-red-500 hover:bg-red-500 hover:text-white transition-colors duration-200 px-4 py-2 rounded-md text-sm"
|
||||
>
|
||||
Lihat Semua
|
||||
|
|
|
|||
|
|
@ -289,7 +289,26 @@ export default function FilterImageComponent(props: {
|
|||
</Carousel>
|
||||
<div className="flex justify-center mt-1 mb-6">
|
||||
<Link
|
||||
href={isRegional ? `/regional/all-polda/image/all` : href}
|
||||
href={`${
|
||||
asPath.includes("/polda/")
|
||||
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
: ""
|
||||
}/image/${
|
||||
group || asPath.includes("/polda/") ? "regional?" : "filter?"
|
||||
}${sortByOpt === "popular" ? "sortBy=popular" : "sortBy=latest"}${
|
||||
title ? `&title=${title.toLowerCase()}` : ""
|
||||
}${categorie ? `&category=${categorie}` : ""}${
|
||||
startDateString ? `&startDate=${startDateString}` : ""
|
||||
}${endDateString ? `&endDate=${endDateString}` : ""}${
|
||||
monthYearFilter
|
||||
? `&month=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]}`
|
||||
: ""
|
||||
}${
|
||||
monthYearFilter
|
||||
? `&year=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[1]}`
|
||||
: ""
|
||||
}`}
|
||||
// href={isRegional ? `/regional/all-polda/image/all` : href}
|
||||
className="border border-red-500 text-red-500 hover:bg-red-500 text-sm hover:text-white px-4 py-2 rounded transition duration-200"
|
||||
>
|
||||
Lihat Semua
|
||||
|
|
|
|||
|
|
@ -258,27 +258,27 @@ export default function FilterVideoComponent(props: {
|
|||
</Carousel>
|
||||
<div className="flex justify-center mt-1 mb-6">
|
||||
<Link
|
||||
// href={`${
|
||||
// asPath.includes("/polda/")
|
||||
// ? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
// : ""
|
||||
// }/video/${
|
||||
// group || asPath.includes("/polda/") ? "regional?" : "filter?"
|
||||
// }${sortByOpt === "popular" ? "sortBy=popular" : "sortBy=latest"}${
|
||||
// title ? `&title=${title.toLowerCase()}` : ""
|
||||
// }${categorie ? `&category=${categorie}` : ""}${
|
||||
// startDateString ? `&startDate=${startDateString}` : ""
|
||||
// }${endDateString ? `&endDate=${endDateString}` : ""}${
|
||||
// monthYearFilter
|
||||
// ? `&month=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]}`
|
||||
// : ""
|
||||
// }${
|
||||
// monthYearFilter
|
||||
// ? `&year=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[1]}`
|
||||
// : ""
|
||||
// }`}
|
||||
href={`${
|
||||
asPath.includes("/polda/")
|
||||
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
|
||||
: ""
|
||||
}/video/${
|
||||
group || asPath.includes("/polda/") ? "regional?" : "filter?"
|
||||
}${sortByOpt === "popular" ? "sortBy=popular" : "sortBy=latest"}${
|
||||
title ? `&title=${title.toLowerCase()}` : ""
|
||||
}${categorie ? `&category=${categorie}` : ""}${
|
||||
startDateString ? `&startDate=${startDateString}` : ""
|
||||
}${endDateString ? `&endDate=${endDateString}` : ""}${
|
||||
monthYearFilter
|
||||
? `&month=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]}`
|
||||
: ""
|
||||
}${
|
||||
monthYearFilter
|
||||
? `&year=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[1]}`
|
||||
: ""
|
||||
}`}
|
||||
|
||||
href={isRegional ? `/regional/all-polda/video/all` : href}
|
||||
// href={isRegional ? `/regional/all-polda/video/all` : href}
|
||||
className="border border-red-500 text-red-500 hover:bg-red-500 hover:text-white px-4 py-2 text-sm rounded transition duration-200"
|
||||
>
|
||||
Lihat Semua
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ const Navbar = () => {
|
|||
? `/polda/${poldaName}`
|
||||
: satkerName
|
||||
? `/satker/${satkerName}`
|
||||
: "";
|
||||
: "/";
|
||||
|
||||
let menu = "";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue