Skip to content

Commit

Permalink
bundle of bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HoodieRocks committed Jan 28, 2024
1 parent 5a6d3b0 commit 5946d44
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/lib/components/markdown/MarkdownEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
Disabled for security issues!
</p>
{:else}
<input type="text" name="{name}" id="{name}" value="{content}" class="hidden">
<div class="input w-full">
<MarkdownComponent source="{content}" />
</div>
Expand Down
2 changes: 0 additions & 2 deletions src/lib/components/project/ProjectInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
if (isNew == true) nextStepsModal.open();
});
console.log(project);
let mm: HTMLDivElement;
let status = project.status ?? "unpublished";
Expand Down
2 changes: 0 additions & 2 deletions src/routes/project/[project]/edit/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export const actions = {
const project = projectSchema.parse(await projectRequest.json());

if (!form.valid) {
console.log("Error:", form);
return fail(400, { form });
}

Expand Down Expand Up @@ -195,7 +194,6 @@ export const actions = {
redirect(307, "/project/" + project.url);
} else {
const error = await result.text();
console.error(error);
return setError(form, error);
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/routes/projects/new/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ export const actions = {
const form = await superValidate(formData, newProjectSchema);

if (!form.valid) {
console.log("Error:", form);
return fail(400, { form });
}

Expand All @@ -102,6 +101,12 @@ export const actions = {
icon = await blobToB64(formDataIcon);
}

const slugCheck = await fetch(`${API}/projects/get/${data.url}`);

if (slugCheck.ok) {
return setError(form, "This slug is already in use!")
}

const projData = {
icon,
type: "datapack",
Expand Down
4 changes: 2 additions & 2 deletions src/routes/projects/new/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<label
for="url"
class="col-span-2 mb-2 mt-4 text-zinc-950 dark:text-zinc-100">
URL
SLug
</label>
<input
id="url"
Expand All @@ -111,7 +111,7 @@
placeholder="slug-for-your-pack"
bind:value="{$form.url}"
class="input w-full" />
{#if $errors.url}<span class="invalid">{$errors.url}</span>{/if}
{#if $errors.url}<span class="invalid">{$errors.url.join(", ")}</span>{/if}
</div>
</div>

Expand Down

0 comments on commit 5946d44

Please sign in to comment.