Skip to content

Commit 5d228f1

Browse files
committed
convert billable query string to boolean for shared report #876
billable is handled as a string filter for the query parameters as they are otherwise converted to 0 and 1, but for the report save request it should be a boolean
1 parent f68f05d commit 5d228f1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

resources/js/Components/Common/Reporting/ReportingOverview.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,19 @@ async function createTag(tag: string) {
161161
}
162162
163163
const reportProperties = computed(() => {
164+
const { billable, ...rest } = getFilterAttributes();
165+
166+
let billableValue: boolean | null = null;
167+
// if billable is null keep it if it is 'true' or 'false' convert it to boolean
168+
if (billable === 'true') {
169+
billableValue = true;
170+
} else if (billable === 'false') {
171+
billableValue = false;
172+
}
173+
164174
return {
165-
...getFilterAttributes(),
175+
...rest,
176+
billable: billableValue,
166177
group: group.value,
167178
sub_group: subGroup.value,
168179
history_group: getOptimalGroupingOption(startDate.value, endDate.value),

0 commit comments

Comments
 (0)