Skip to content

Commit 3be42d3

Browse files
committed
feat: #309 - Make riskWithSources endpoint public
1 parent 8c4036e commit 3be42d3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

frontend/src/api/apiClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const handleRuleExtraction = async (guid: string) => {
7171

7272
const fetchRiskDataWithSources = async (medication: string, source: "include" | "diagnosis" = "include") => {
7373
try {
74-
const response = await adminApi.post(`/v1/api/riskWithSources`, {
74+
const response = await publicApi.post(`/v1/api/riskWithSources`, {
7575
drug: medication,
7676
source: source,
7777
});

server/api/views/risk/views_riskWithSources.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
from rest_framework.views import APIView
22
from rest_framework.response import Response
33
from rest_framework import status
4+
from rest_framework.permissions import AllowAny
45
from api.views.listMeds.models import Medication
56
from api.models.model_medRule import MedRule, MedRuleSource
67
import openai
78
import os
89

910

1011
class RiskWithSourcesView(APIView):
12+
permission_classes = [AllowAny]
13+
1114
def post(self, request):
1215
openai.api_key = os.environ.get("OPENAI_API_KEY")
1316

0 commit comments

Comments
 (0)