Skip to content

Commit

Permalink
Merge pull request #289 from ertush/hotfix-dev
Browse files Browse the repository at this point in the history
Fixed community units edit page
  • Loading branch information
ertush authored Jan 16, 2024
2 parents 04698bc + 0f50233 commit af1ea61
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pages/community-units/edit/[id].js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export async function getServerSideProps({req, res, query}) {
for( let option of options){
switch(option){

case "cu":
case "cu":getServerSideProps
const cu = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/chul/units/${query.id}/`,{
headers:{
'Authorization': 'Bearer ' + token,
Expand All @@ -99,8 +99,8 @@ export async function getServerSideProps({req, res, query}) {

case "facilities":

const count = await getFacilityCount(token)

getFacilityCount(token)
.then(async ({count}) => {
const facilities = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/facilities/facilities/?page_size=${count ?? '500'}&fields=id,name,county,sub_county_name,constituency,ward_name`,{
headers:{
'Authorization': 'Bearer ' + token,
Expand All @@ -110,6 +110,8 @@ export async function getServerSideProps({req, res, query}) {
})

response["facilities"] = (await (await facilities.json()))?.results?.map(({ id, name }) => ({ label: name, value: id }))

})
break;

case "contact_types":
Expand Down

1 comment on commit af1ea61

@vercel
Copy link

@vercel vercel bot commented on af1ea61 Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kmhfl-upgrade-alpha-ui – ./

kmhfl-upgrade-alpha-ui-git-main-ertush.vercel.app
kmhflv3.vercel.app
kmhfl-upgrade-alpha-ui-ertush.vercel.app

Please sign in to comment.