def METHOD_NAME(project_id, user_id, data: schemas.SavedSearchSchema):
    with pg_client.PostgresClient() as cur:
        data = data.dict()
        data["filter"] = json.dumps(data["filter"])
        query = cur.mogrify("""\
            INSERT INTO public.searches (project_id, user_id, name, filter,is_public) 
            VALUES (%(project_id)s, %(user_id)s, %(name)s, %(filter)s::jsonb,%(is_public)s)
            RETURNING *;""", {"user_id": user_id, "project_id": project_id, **data})
        cur.execute(
            query
        )
        r = cur.fetchone()
        r["created_at"] = TimeUTC.datetime_to_timestamp(r["created_at"])
        r["filter"] = helper.old_search_payload_to_flat(r["filter"])
        r = helper.dict_to_camel_case(r)
        return {"data": r}