def add_goal_to_payload(func):
    "Adds a goal to payload for 't-goal' key."

    @functools.wraps(func)
    def wrapper_inject_goal(ack: Ack, payload: Dict[(str, Any)], context: BoltContext):
        try:
            content = GoalContent(content=payload['state']['values'][CREATE_GOAL_INPUT_BLOCK][CREATE_GOAL_INPUT]['value']).content
        except ValidationError as error:
            return ack(response_action='errors', errors={CREATE_GOAL_INPUT_BLOCK: error.errors()[0]['msg']})
        payload['t-goal'] = content
        return func(ack=ack, payload=payload, context=context)
    return wrapper_inject_goal
Adds a goal to payload for 't-goal' key.
def add_goal_to_payload(func):
    

    @functools.wraps(func)
    def wrapper_inject_goal(ack: Ack, payload: Dict[(str, Any)], context: BoltContext):
        try:
            content = GoalContent(content=payload['state']['values'][CREATE_GOAL_INPUT_BLOCK][CREATE_GOAL_INPUT]['value']).content
        except ValidationError as error:
            return ack(response_action='errors', errors={CREATE_GOAL_INPUT_BLOCK: error.errors()[0]['msg']})
        payload['t-goal'] = content
        return func(ack=ack, payload=payload, context=context)
    return wrapper_inject_goal