Skip to content

Commit

Permalink
Make project.description optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Florens Verschelde committed Mar 10, 2023
1 parent ca0ecc6 commit 5e6fa35
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export function createProjectForm(project: Project) {
form.setAttribute('style', 'display:none!important;');

form.appendChild(createHiddenInput('project[title]', project.title));
form.appendChild(createHiddenInput('project[description]', project.description));
if (project.description) {
form.appendChild(createHiddenInput('project[description]', project.description));
}
form.appendChild(createHiddenInput('project[template]', project.template));

if (project.dependencies) {
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { PROJECT_TEMPLATES } from './constants';

export interface Project {
title: string;
description: string;
description?: string;
/**
* The project’s template name tells StackBlitz how to compile and run project files.
*
Expand Down
1 change: 0 additions & 1 deletion test/e2e/embedVm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ test('vm.getFsSnapshot and vm.applyFsDiff', async ({ page }) => {
const project: Project = {
title: 'Test Project',
template: 'html',
description: '',
files: {
'index.html': `<h1>Hello World</h1>`,
'styles.css': `body { color: lime }`,
Expand Down

0 comments on commit 5e6fa35

Please sign in to comment.