処理順序修正

This commit is contained in:
ろむねこ 2024-07-17 14:27:06 +09:00
parent b3f2789e48
commit 0aec73c4ac
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168

View File

@ -84,6 +84,9 @@ const KidShiftTaskCompleteIntentHandler = {
},
async handle(handlerInput: Alexa.HandlerInput) {
const attributeUtils = new AttributeUtils(handlerInput);
TaskService.setToken(await attributeUtils.getToken());
const taskList: TaskListResponse = await TaskService.getTasks()
const childList: ChildListResponse = await ChildService.getChildList();
@ -106,9 +109,6 @@ const KidShiftTaskCompleteIntentHandler = {
.getResponse();
}
const attributeUtils = new AttributeUtils(handlerInput);
TaskService.setToken(await attributeUtils.getToken());
return TaskService.completeTask(task.id, child.id).then(() => {
return handlerInput.responseBuilder
.speak('Task completed')