Dieser Commit ist enthalten in:
Ursprung
926624542d
Commit
0a0946e335
@ -24,19 +24,12 @@
|
||||
import {createEventDispatcher} from "svelte";
|
||||
import type {Player} from "@type/data.ts";
|
||||
import dayjs from "dayjs";
|
||||
import {schemRepo} from "@repo/schem.ts";
|
||||
import SWModal from "@components/styled/SWModal.svelte";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
export let info: SchematicInfo;
|
||||
export let user: Player;
|
||||
|
||||
async function download() {
|
||||
const code = await $schemRepo.createDownload(info.schem.id);
|
||||
window.open(import.meta.env.PUBLIC_API_SERVER + "/download/" + code.code, "_blank")
|
||||
dispatch("reset")
|
||||
}
|
||||
</script>
|
||||
|
||||
<SWModal title={info.schem.name} open on:close={() => dispatch("reset")}>
|
||||
@ -71,9 +64,6 @@
|
||||
<p class="!mt-0">{t("dashboard.schematic.info.members", {members: info.members.map(value => value.name).join(", ")})}</p>
|
||||
{/if}
|
||||
<svelte:fragment slot="footer">
|
||||
{#if (info.schem.owner === user.id)}
|
||||
<button class="btn !ml-auto" on:click={download}>{t("dashboard.schematic.info.btn.download")}</button>
|
||||
{/if}
|
||||
<button class="btn" class:!ml-auto={info.schem.owner !== user.id} on:click={() => dispatch("reset")}>{t("dashboard.schematic.info.btn.close")}</button>
|
||||
</svelte:fragment>
|
||||
</SWModal>
|
@ -37,10 +37,6 @@ export class SchematicRepo {
|
||||
return await fetchWithToken(this.token, `/schem/${id}`).then(value => value.json()).then(SchematicInfoSchema.parse);
|
||||
}
|
||||
|
||||
public async createDownload(id: number): Promise<SchematicCode> {
|
||||
return await fetchWithToken(this.token, `/schem/${id}/download`).then(value => value.json()).then(SchematicCodeSchema.parse);
|
||||
}
|
||||
|
||||
public async uploadSchematic(name: string, content: string) {
|
||||
return await fetchWithToken(this.token, "/schem", {
|
||||
method: "POST",
|
||||
|
@ -1,5 +1,5 @@
|
||||
build:
|
||||
- "echo 'PUBLIC_API_SERVER=https://steamwar.de/eventplanner-api/'"
|
||||
- "echo 'PUBLIC_API_SERVER=https://steamwar.de/api/'"
|
||||
- "pnpm run ci"
|
||||
|
||||
release:
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren