mirror of
https://github.com/Hackdex-App/hackdex-website.git
synced 2026-09-14 03:46:47 -05:00
Use is_archive for checking hack archive status
This commit is contained in:
@@ -18,6 +18,7 @@ type Archive = {
|
||||
creator_username: string | null;
|
||||
approved: boolean;
|
||||
current_patch: number | null;
|
||||
is_archive: boolean;
|
||||
};
|
||||
|
||||
type ArchivesData =
|
||||
|
||||
@@ -436,7 +436,7 @@ export default function HackSubmitForm({
|
||||
if (github) fd.set('github', github);
|
||||
if (tags.length) fd.set('tags', tags.join(','));
|
||||
if (isArchive) {
|
||||
fd.set('isArchive', 'true');
|
||||
fd.set('is_archive', 'true');
|
||||
}
|
||||
if (originalAuthor) {
|
||||
fd.set('original_author', originalAuthor);
|
||||
@@ -632,6 +632,7 @@ export default function HackSubmitForm({
|
||||
: undefined,
|
||||
createdAt: new Date().toISOString(),
|
||||
patchUrl: "",
|
||||
is_archive: isArchive,
|
||||
};
|
||||
|
||||
const hasBaseRom = !!baseRom.trim();
|
||||
|
||||
@@ -24,11 +24,11 @@ export interface HackCardAttributes {
|
||||
version: string;
|
||||
summary?: string;
|
||||
description?: string;
|
||||
isArchive?: boolean;
|
||||
is_archive: boolean;
|
||||
};
|
||||
|
||||
export default function HackCard({ hack, clickable = true, className = "" }: { hack: HackCardAttributes; clickable?: boolean; className?: string }) {
|
||||
const isArchive = !!hack.isArchive;
|
||||
const isArchive = hack.is_archive;
|
||||
const { isLinked, hasPermission, hasCached } = useBaseRoms();
|
||||
const match = baseRoms.find((r) => r.id === hack.baseRomId);
|
||||
const baseId = match?.id ?? undefined;
|
||||
|
||||
Reference in New Issue
Block a user