feat: update checkbox actions to include type parameter
- Modified `addTodayCheckboxAction` and `addYesterdayCheckboxAction` to accept a `type` parameter for better flexibility in checkbox creation. - Updated corresponding function signatures in `daily.ts` to reflect the new parameter, ensuring consistent usage across the application.
This commit is contained in:
@@ -87,7 +87,7 @@ export function useDaily(initialDate?: Date, initialDailyView?: DailyView): UseD
|
|||||||
try {
|
try {
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
const result = await addTodayCheckboxAction(text, taskId);
|
const result = await addTodayCheckboxAction(text, type, taskId);
|
||||||
|
|
||||||
if (result.success && result.data) {
|
if (result.success && result.data) {
|
||||||
// Mise à jour optimiste
|
// Mise à jour optimiste
|
||||||
@@ -117,7 +117,7 @@ export function useDaily(initialDate?: Date, initialDailyView?: DailyView): UseD
|
|||||||
try {
|
try {
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
const result = await addYesterdayCheckboxAction(text, taskId);
|
const result = await addYesterdayCheckboxAction(text, type, taskId);
|
||||||
|
|
||||||
if (result.success && result.data) {
|
if (result.success && result.data) {
|
||||||
// Mise à jour optimiste
|
// Mise à jour optimiste
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ export async function addCheckboxToDaily(dailyId: string, content: string, taskI
|
|||||||
/**
|
/**
|
||||||
* Ajoute une checkbox pour aujourd'hui
|
* Ajoute une checkbox pour aujourd'hui
|
||||||
*/
|
*/
|
||||||
export async function addTodayCheckbox(content: string, taskId?: string): Promise<{
|
export async function addTodayCheckbox(content: string, type?: 'task' | 'meeting', taskId?: string): Promise<{
|
||||||
success: boolean;
|
success: boolean;
|
||||||
data?: DailyCheckbox;
|
data?: DailyCheckbox;
|
||||||
error?: string;
|
error?: string;
|
||||||
@@ -88,6 +88,7 @@ export async function addTodayCheckbox(content: string, taskId?: string): Promis
|
|||||||
const newCheckbox = await dailyService.addCheckbox({
|
const newCheckbox = await dailyService.addCheckbox({
|
||||||
date: new Date(),
|
date: new Date(),
|
||||||
text: content,
|
text: content,
|
||||||
|
type: type || 'task',
|
||||||
taskId
|
taskId
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -105,7 +106,7 @@ export async function addTodayCheckbox(content: string, taskId?: string): Promis
|
|||||||
/**
|
/**
|
||||||
* Ajoute une checkbox pour hier
|
* Ajoute une checkbox pour hier
|
||||||
*/
|
*/
|
||||||
export async function addYesterdayCheckbox(content: string, taskId?: string): Promise<{
|
export async function addYesterdayCheckbox(content: string, type?: 'task' | 'meeting', taskId?: string): Promise<{
|
||||||
success: boolean;
|
success: boolean;
|
||||||
data?: DailyCheckbox;
|
data?: DailyCheckbox;
|
||||||
error?: string;
|
error?: string;
|
||||||
@@ -117,6 +118,7 @@ export async function addYesterdayCheckbox(content: string, taskId?: string): Pr
|
|||||||
const newCheckbox = await dailyService.addCheckbox({
|
const newCheckbox = await dailyService.addCheckbox({
|
||||||
date: yesterday,
|
date: yesterday,
|
||||||
text: content,
|
text: content,
|
||||||
|
type: type || 'task',
|
||||||
taskId
|
taskId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user