def post(self): """create a new store""" data = api.payload name = data["name"] user_id = get_jwt_identity() store = StoreModel.fetch_by_name(name) if store: return {"message": "a store by that name already exists"}, 400 else: store = StoreModel(**data, user_id=user_id) store.save_to_db() return store_schema.dump(store)