[PROTOBUS] Move showTaskWithID to protobus (#3283)
* showTaskWithID protobus migration * replaced ShowTaskWithIdRequest with generic stringRequest * prettier
This commit is contained in:
1 parent
a02bf11c81
commit
ca3cf185cf
8 files changed
+34
-6
No files matched your search
@@ -8,6 +8,7 @@ import { clearTask } from "./clearTask"
|
||||
import { deleteTasksWithIds } from "./deleteTasksWithIds"
|
||||
import { exportTaskWithId } from "./exportTaskWithId"
|
||||
import { newTask } from "./newTask"
|
||||
import { showTaskWithId } from "./showTaskWithId"
|
||||
|
||||
// Register all task service methods
|
||||
export function registerAllMethods(): void {
|
||||
@@ -17,4 +18,5 @@ export function registerAllMethods(): void {
|
||||
registerMethod("deleteTasksWithIds", deleteTasksWithIds)
|
||||
registerMethod("exportTaskWithId", exportTaskWithId)
|
||||
registerMethod("newTask", newTask)
|
||||
registerMethod("showTaskWithId", showTaskWithId)
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Controller } from ".."
|
||||
import { Empty, StringRequest } from "../../../shared/proto/common"
|
||||
|
||||
/**
|
||||
* Shows a task with the specified ID
|
||||
* @param controller The controller instance
|
||||
* @param request The request containing the task ID
|
||||
* @returns Empty response
|
||||
*/
|
||||
export async function showTaskWithId(controller: Controller, request: StringRequest): Promise<Empty> {
|
||||
try {
|
||||
await controller.showTaskWithId(request.value)
|
||||
return Empty.create()
|
||||
} catch (error) {
|
||||
throw error
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user