Пример #1
0
def delete_ad(user_id, ad_id):
    ad_data = request.get_json(force=True, silent=True)
    if ad_data == None:
        return "Bad request", 400

    ad = Ad.find_by_id(ad_id)
    if ad.creator_id is not user_id:
        return "Forbidden", 403
    
    Ad.delete(ad_id)
    return ""
Пример #2
0
def delete_ad(owner_id):
    Ad.delete(owner_id)
    return "Deleted succesfully"