fix: ids in functions

This commit is contained in:
Arman
2025-03-27 11:39:47 +01:00
parent 26440812c2
commit ff49fbf070
3 changed files with 6 additions and 9 deletions
@@ -44,7 +44,7 @@
let isSubmitting = writable(false);
let name = '';
let id = ID.unique();
let id: string;
let runtime: Runtime;
let entrypoint = '';
let buildCommand = '';
@@ -58,7 +58,7 @@
console.log(runtime);
const func = await sdk.forProject.functions.create(
id,
id || ID.unique(),
name,
runtime,
undefined,
@@ -46,7 +46,7 @@
let isSubmitting = writable(false);
let name = '';
let id = ID.unique();
let id: string;
let runtime: Runtime;
let entrypoint = '';
let buildCommand = '';
@@ -66,7 +66,7 @@
async function create() {
try {
const func = await sdk.forProject.functions.create(
id,
id || ID.unique(),
name,
runtime,
undefined,
@@ -50,7 +50,7 @@
let isSubmitting = writable(false);
let name = data.template.name;
let id = ID.unique();
let id: string;
let runtime: Runtime;
let branch = 'main';
let rootDir = './';
@@ -70,10 +70,7 @@
onMount(async () => {
if ($page.url.searchParams.has('runtime')) {
console.log(runtime);
console.log($page.url.searchParams.get('runtime'));
runtime = $page.url.searchParams.get('runtime') as Runtime;
console.log(runtime);
}
if (!$installation?.$id) {
$installation = data.installations.installations[0];
@@ -127,7 +124,7 @@
const rt = data.template.runtimes.find((r) => r.name === runtime);
const func = await sdk.forProject.functions.create(
id,
id || ID.unique(),
name,
runtime as Runtime,
data.template.permissions?.length ? data.template.permissions : undefined,