Skip to content

Commit

Permalink
fixing up UI folder
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenNaihin committed Feb 11, 2024
1 parent 82ec6cc commit 03485c6
Show file tree
Hide file tree
Showing 160 changed files with 931 additions and 3,161 deletions.
166 changes: 0 additions & 166 deletions ui/app/api/modify-frontend-component/push-stack-to-github.ts

This file was deleted.

23 changes: 0 additions & 23 deletions ui/app/api/modify-frontend-component/route.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getSupabaseClient } from '@/app/components/stacks/utils/stack-db';

import { getSupabaseClient } from '@/app/stacks/stack-db';
import getFileFromGithub from './get-file-from-github';
import pushMultipleFilesToBranch from './push-multiple-files-to-branch';

Expand All @@ -8,32 +8,31 @@ export default async function createStack(data, token) {
.replace(/([a-z])([A-Z])/g, '$1-$2')
.replace(/\s+/g, '-')
.toLowerCase();

const supabase = await getSupabaseClient();
const stackInfo = {
name: data.name,
id: stackId,
description: data.description,
tags: ['draft'],
}
const { data: insertedData, error } = await supabase
};
const { data: insertedData, error } = await supabase
.from('stack')
.insert([
stackInfo
])
.insert([stackInfo])
.single();
if (error) {
if (error.message.includes('duplicate key ')) {
throw new Error('This app already exists.');
}
throw error;
if (error) {
if (error.message.includes('duplicate key ')) {
throw new Error('This app already exists.');
}

throw error;
}

// creating api key
let path = `ui/app/components/stacks/${stackInfo.id}.tsx`;
let path = `ui/app/components/stacks/v1/${stackInfo.id}.tsx`;
let message = `Frontend For ${stackInfo.id} created`;
let response = await getFileFromGithub(
'ui/public/stacks/boilerplate-basic.tsx', token
'ui/public/stacks/v1/boilerplate-basic.tsx',
token,
);
await new Promise((resolve) => setTimeout(resolve, 500));

Expand All @@ -45,10 +44,11 @@ export default async function createStack(data, token) {
},
];

path = `ui/app/api/${stackInfo.id}/route.ts`;
path = `ui/app/api/stacks/v1/${stackInfo.id}/route.ts`;
message = `Backend For ${stackInfo.id} created`;
response = await getFileFromGithub(
'ui/public/stacks/boilerplate-basic/route.ts', token
'ui/public/stacks/v1/boilerplate-basic/route.ts',
token,
);
await new Promise((resolve) => setTimeout(resolve, 500));

Expand All @@ -62,7 +62,8 @@ export default async function createStack(data, token) {
message = `Preview For ${stackInfo.id} created`;

response = await getFileFromGithub(
'ui/public/stack-pictures/boilerplate-basic.png', token
'ui/public/stack-pictures/boilerplate-basic.png',
token,
);
await new Promise((resolve) => setTimeout(resolve, 500));

Expand All @@ -73,6 +74,10 @@ export default async function createStack(data, token) {
});
// const sourceBranch = process.env.VERCEL_GIT_COMMIT_REF ?? ''; // or 'master', depending on your repository

const prLink = await pushMultipleFilesToBranch(filesArray, stackInfo.id, token);
const prLink = await pushMultipleFilesToBranch(
filesArray,
stackInfo.id,
token,
);
return prLink;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions ui/app/api/stackwise-onboarding/route.ts

This file was deleted.

97 changes: 0 additions & 97 deletions ui/app/api/suggest-frontend-component/route.ts

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 03485c6

Please sign in to comment.