fix: lint

This commit is contained in:
Atharva Deosthale
2025-09-03 11:32:37 +05:30
parent d4eb3c7be2
commit 2ca56307c0
6 changed files with 20 additions and 17 deletions
@@ -11,7 +11,7 @@ export const load: PageLoad = async ({ url, params, parent }) => {
}
// Parse repository information
const repoMatch = repoUrl.match(/github\.com[\/:]([^\/]+)\/([^\/\?\s]+)/);
const repoMatch = repoUrl.match(/github\.com[/:]([^/]+)\/([^/?s]+)/);
if (!repoMatch) {
redirect(302, `${base}/project-${params.region}-${params.project}/functions`);
}
@@ -12,7 +12,7 @@ export const load: PageLoad = async ({ url, params }) => {
}
// Parse repository information
const repoMatch = repoUrl.match(/github\.com[\/:]([^\/]+)\/([^\/\?\s]+)/);
const repoMatch = repoUrl.match(/github\.com[/:]([^/]+)\/([^/?s]+)/);
if (!repoMatch) {
redirect(302, `${base}/project-${params.region}-${params.project}/sites`);
}
@@ -188,7 +188,7 @@
label="Organization"
required
placeholder="Select an organization"
options={data.organizations.teams.map((o: any) => ({
options={data.organizations.teams.map((o) => ({
label: o.name,
value: o.$id
}))}
+15 -12
View File
@@ -34,18 +34,27 @@ export const load: PageLoad = async ({ parent, url }) => {
const envKeys = envParam ? envParam.split(',').map((key: string) => key.trim()) : [];
const name = url.searchParams.get('name');
let deploymentData: {
const deploymentData: {
type: 'repo';
repository: { url: string; owner: string; name: string };
runtime?: string;
name?: string;
} = {
type: 'repo',
repository: {
url: repoUrl!,
owner: '',
name: ''
},
runtime: runtime || 'node-18.0',
name: name || ''
};
// Get available runtimes
const runtimesList = await sdk.forConsole.functions.listRuntimes();
// Repository deployment only
const repoMatch = repoUrl!.match(/github\.com[\/:]([^\/]+)\/([^\/\?\s]+)/);
const repoMatch = repoUrl!.match(/github\.com[/:]([^/]+)\/([^/?s]+)/);
if (!repoMatch) {
redirect(302, base + '/');
}
@@ -54,16 +63,10 @@ export const load: PageLoad = async ({ parent, url }) => {
// Clean repository name (remove .git extension if present)
const cleanRepoName = repoName.replace(/\.git$/, '');
deploymentData = {
type: 'repo',
repository: {
url: repoUrl!,
owner,
name: cleanRepoName
},
runtime: runtime || 'node-18.0', // Default to Node.js if not specified
name: name || cleanRepoName
};
// Update deployment data with parsed repository info
deploymentData.repository.owner = owner;
deploymentData.repository.name = cleanRepoName;
deploymentData.name = name || cleanRepoName;
// Get organizations
let organizations: Models.TeamList<Record<string, unknown>> | OrganizationList | undefined;
@@ -311,7 +311,7 @@
label="Organization"
required
placeholder="Select an organization"
options={data.organizations.teams.map((o: any) => ({
options={data.organizations.teams.map((o) => ({
label: o.name,
value: o.$id
}))}
+1 -1
View File
@@ -64,7 +64,7 @@ export const load: PageLoad = async ({ parent, url }) => {
}
} else {
// Repository deployment
const repoMatch = repoUrl!.match(/github\.com[\/:]([^\/]+)\/([^\/\?\s]+)/);
const repoMatch = repoUrl!.match(/github\.com[/:]([^/]+)\/([^/?s]+)/);
if (!repoMatch) {
redirect(302, base + '/');
}