'use server';
import { resolve } from '../../lib/server-container.js';
export async function updateWorkItem(workItemId, input) {
    if (!workItemId?.trim()) {
        return { error: 'Work item ID is required' };
    }
    try {
        const useCase = resolve('UpdateWorkItemUseCase');
        const result = await useCase.execute(workItemId, input);
        if (!result.ok)
            return { error: result.error };
        return {};
    }
    catch (error) {
        const message = error instanceof Error ? error.message : 'Failed to update work item';
        return { error: message };
    }
}
