Exemple #1
0
    def post(self):
        data = request.json

        token = request.headers['authorization']

        decoded_token = auth.verify_id_token(token)
        uid = decoded_token['uid']

        accept_application_response = ApplicationDAO.accept_application(
            uid, data)

        return accept_application_response
Exemple #2
0
    def post(self):
        data = request.json

        state = data["state"]
        district = data["district"] if data["district"] else ""
        sub_district = data["sub_district"] if data["sub_district"] else ""
        area = data["area"] if data["area"] else ""

        list_application_response = ApplicationDAO.list_application_with_args(
            state, district, sub_district, area)

        return list_application_response
Exemple #3
0
    def post(self):
        data = request.json

        token = request.headers['authorization']
        args = request.args

        decoded_token = auth.verify_id_token(token)
        uid = decoded_token['uid']

        reserved_application_id = args.get("reserved_application_id")
        verify_application_response = ApplicationDAO.verify_application(
            uid, reserved_application_id)

        return verify_application_response
Exemple #4
0
    def post(self):
        data = request.json

        token = request.headers['authorization']

        decoded_token = auth.verify_id_token(token)
        uid = decoded_token['uid']

        not_valid = validate_application_submit_data(data)

        if not_valid:
            return not_valid

        submit_application_response = ApplicationDAO.create_application(
            uid, data)

        return submit_application_response
Exemple #5
0
    def get(self):

        list_application_response = ApplicationDAO.list_application()

        return list_application_response