Skip to content

Commit 905f130

Browse files
committed
fix issue #9
1 parent ddceae4 commit 905f130

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/App.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const App: Component = () => {
3232
title: "",
3333
description: "",
3434
labels: [] as string[],
35-
project: "",
35+
projects: [] as string[],
3636
assignees: "",
3737
sections: [{ type: "Markdown", value: "" }] as Section[],
3838
});
@@ -56,10 +56,11 @@ const App: Component = () => {
5656
name: store.name,
5757
title: store.title,
5858
description: store.description,
59+
projects: store.projects
5960
};
6061

6162
if (store.labels.length) topFields.labels = store.labels;
62-
if (store.project.trim()) topFields.project = store.project;
63+
if (store.projects.length) topFields.projects = store.projects;
6364
if (store.assignees.trim()) topFields.assignees = store.assignees;
6465

6566
const formData = store.sections
@@ -127,7 +128,7 @@ const App: Component = () => {
127128
<div class="container">
128129
<div class="grid md:grid-cols-2 gap-10">
129130
<div class="space-y-4 my-4">
130-
{["name", "title", "description", "labels", "project", "assignees"].map((field) => (
131+
{["name", "title", "description", "labels", "projects", "assignees"].map((field) => (
131132
<div class="space-y-1">
132133
<label for={`${field}-input`} class="text-sm capitalize">{field}</label>
133134
{field === "description" ? (
@@ -145,17 +146,17 @@ const App: Component = () => {
145146
placeholder={`Enter ${field}`}
146147
class="w-full"
147148
value={
148-
field === "labels"
149+
field === "labels" || field === "projects"
149150
? (store.labels || []).join(", ")
150151
: (store[field as keyof typeof store] as string)
151152
}
152153
onInput={(e) => {
153-
if (field === "labels") {
154+
if (field === "labels" || field === "projects") {
154155
const newLabels = e.currentTarget.value
155156
.split(",")
156157
.map((label) => label.trim())
157158
.filter(Boolean);
158-
setStore("labels", newLabels);
159+
setStore(field, newLabels);
159160
} else {
160161
setStore(field as keyof typeof store, e.currentTarget.value);
161162
}

0 commit comments

Comments
 (0)