Skip to content

Commit 74f4b12

Browse files
committed
refactor(repo): reduce multi-line object to one line where possible
Signed-off-by: Zacharias Fragkiadakis <[email protected]>
1 parent 602cfb1 commit 74f4b12

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

stores/tasks.ts

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ export const useTasksStore = defineStore('tasks', () => {
3030
}
3131

3232
const tasksByColumn = orderTasksByColumn(
33-
groupTasksByColumn({
34-
tasks: filteredTasks.value,
35-
columns: board.state.columns,
36-
}),
33+
groupTasksByColumn({ tasks: filteredTasks.value, columns: board.state.columns }),
3734
)
3835

3936
return tasksByColumn
@@ -62,11 +59,7 @@ export const useTasksStore = defineStore('tasks', () => {
6259
return
6360
}
6461

65-
const newTask = {
66-
...task,
67-
labels,
68-
rpb,
69-
}
62+
const newTask = { ...task, labels, rpb }
7063

7164
tasks.value = tasks.value.with(taskIndex, newTask as Task)
7265
}
@@ -172,15 +165,8 @@ export const useTasksStore = defineStore('tasks', () => {
172165

173166
return {
174167
task,
175-
labels: createUpdatedTaskLabels(task, {
176-
priority,
177-
column: newColumn,
178-
}),
179-
rpb: {
180-
...task.rpb,
181-
priority,
182-
column: newColumn,
183-
},
168+
labels: createUpdatedTaskLabels(task, { priority, column: newColumn }),
169+
rpb: { ...task.rpb, priority, column: newColumn },
184170
}
185171
},
186172
)
@@ -207,9 +193,7 @@ export const useTasksStore = defineStore('tasks', () => {
207193

208194
const { id } = await $httpd('/projects/{rid}/issues', {
209195
method: 'POST',
210-
path: {
211-
rid: route.params.rid,
212-
},
196+
path: { rid: route.params.rid },
213197
body: {
214198
title,
215199
description: '',
@@ -332,9 +316,7 @@ function useFetchedTasks() {
332316
patchStatuses.map(
333317
async (status) =>
334318
await $httpd('/projects/{rid}/patches', {
335-
path: {
336-
rid: route.params.rid,
337-
},
319+
path: { rid: route.params.rid },
338320
// @ts-expect-error - wrong type definition
339321
query: { perPage: 1000, state: status },
340322
}),

0 commit comments

Comments
 (0)