Skip to content

Commit

Permalink
added remove student api
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestjx committed Sep 26, 2024
1 parent 2140e75 commit 991677a
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
do
$$
DECLARE
remove_student integer;
tutor integer;
BEGIN

-- Api Resource
INSERT INTO qms_auth.api_resource(method, path)
VALUES( 'DELETE', '/class/(\d+)/student/(\d+)');

-- Grants
SELECT id into remove_student FROM qms_auth.api_resource WHERE path = '/class/(\d+)/student/(\d+)' and method = 'DELETE';

select id into tutor FROM qms_auth.role where name = 'tutor';

/*generate question from ai*/
INSERT INTO qms_auth.role_api_resource(resource_id, role_id)
VALUES(remove_student, tutor);

END;
$$;

0 comments on commit 991677a

Please sign in to comment.