forked from inflection-zone/rean-admin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed side bar shrink & expand on click issue * fixed all routes delete issue- toast message & double delete * Added browers default reload behaviour on each form * Added soft reload for login form * Added pagination & sorting on lab record type * Done code clening * Added import functionality for assessment template * Added temp folder for temporary holding assessment template * Import assessment refinement - location for local storage is added --------- Co-authored-by: Dattatraya-Londhe <londhedn@gmail.com>
- Loading branch information
1 parent
8550713
commit f4f2cc6
Showing
167 changed files
with
882 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
import type { RequestEvent } from '@sveltejs/kit'; | ||
import { deleteApiClient } from '../../services/api-clients'; | ||
import { errorMessage, successMessage } from '$lib/utils/message.utils'; | ||
import { redirect } from 'sveltekit-flash-message/server'; | ||
|
||
////////////////////////////////////////////////////////////// | ||
|
||
export const DELETE = async (event: RequestEvent) => { | ||
const request = event.request; | ||
const data = await request.json(); | ||
try { | ||
console.log('Inside api client server endpoints'); | ||
const response = await deleteApiClient(data.sessionId, data.apiClientId); | ||
return new Response(response.message); | ||
} catch (err) { | ||
console.error(`Error deleting api-client: ${err.message}`); | ||
return new Response(err.message); | ||
console.log('Inside api client server endpoints'); | ||
let response; | ||
try{ | ||
response = await deleteApiClient(data.sessionId, data.apiClientId); | ||
}catch(error){ | ||
throw redirect( | ||
errorMessage('Error deleting api-client.'), | ||
event | ||
); | ||
} | ||
throw redirect( | ||
successMessage(response.Message), | ||
event | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
import type { RequestEvent } from '@sveltejs/kit'; | ||
import { deleteAssessmentTemplate } from '../../services/assessment-templates'; | ||
import { errorMessage, successMessage } from '$lib/utils/message.utils'; | ||
import { redirect } from 'sveltekit-flash-message/server'; | ||
|
||
////////////////////////////////////////////////////////////// | ||
|
||
export const DELETE = async (event: RequestEvent) => { | ||
const request = event.request; | ||
const data = await request.json(); | ||
|
||
try { | ||
console.log('Inside assessment template server endpoints'); | ||
const response = await deleteAssessmentTemplate(data.sessionId, data.assessmentTemplateId); | ||
return new Response(response.message); | ||
} catch (err) { | ||
console.error(`Error deleting assessment template: ${err.message}`); | ||
return new Response(err.message); | ||
console.log('Inside assessment template server endpoints'); | ||
let response; | ||
try{ | ||
response = await deleteAssessmentTemplate( | ||
data.sessionId, | ||
data.assessmentTemplateId | ||
); | ||
}catch(error){ | ||
throw redirect( | ||
errorMessage('Error deleting assessment template.'), | ||
event | ||
); | ||
} | ||
throw redirect( | ||
successMessage(response.Message), | ||
event | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import { errorMessage, successMessage } from '$lib/utils/message.utils'; | ||
import { deleteCohort } from '$routes/api/services/cohorts'; | ||
import type { RequestEvent } from '@sveltejs/kit'; | ||
import { redirect } from 'sveltekit-flash-message/server'; | ||
|
||
////////////////////////////////////////////////////////////// | ||
|
||
export const DELETE = async (event: RequestEvent) => { | ||
const request = event.request; | ||
const data = await request.json(); | ||
|
||
try { | ||
console.log('Inside cohort server endpoints'); | ||
const response = await deleteCohort(data.sessionId, data.cohortId); | ||
return new Response(response.message); | ||
} catch (err) { | ||
console.error(`Error deleting cohort: ${err.message}`); | ||
return new Response(err.message); | ||
console.log('Inside cohort server endpoints'); | ||
let response; | ||
try{ | ||
response = await deleteCohort(data.sessionId, data.cohortId); | ||
}catch(error){ | ||
throw redirect( | ||
errorMessage('Error deleting cohort.'), | ||
event | ||
); | ||
} | ||
throw redirect( | ||
successMessage(response.Message), | ||
event | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import type { RequestEvent } from '@sveltejs/kit'; | ||
import { deleteCourse } from '../../services/courses'; | ||
import { errorMessage, successMessage } from '$lib/utils/message.utils'; | ||
import { redirect } from 'sveltekit-flash-message/server'; | ||
|
||
////////////////////////////////////////////////////////////// | ||
|
||
export const DELETE = async (event: RequestEvent) => { | ||
const request = event.request; | ||
const data = await request.json(); | ||
|
||
try { | ||
console.log('Inside course server endpoints'); | ||
const response = await deleteCourse(data.sessionId, data.courseId); | ||
return new Response(response.message); | ||
} catch (err) { | ||
console.error(`Error deleting course: ${err.message}`); | ||
return new Response(err.message); | ||
console.log('Inside course server endpoints'); | ||
let response; | ||
try{ | ||
response = await deleteCourse(data.sessionId, data.courseId); | ||
}catch(error){ | ||
throw redirect( | ||
errorMessage('Error deleting course.'), | ||
event | ||
); | ||
} | ||
throw redirect( | ||
successMessage(response.Message), | ||
event | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import { errorMessage, successMessage } from '$lib/utils/message.utils'; | ||
import { deleteQuery } from '$routes/api/services/custom.query'; | ||
import type { RequestEvent } from '@sveltejs/kit'; | ||
import { redirect } from 'sveltekit-flash-message/server'; | ||
|
||
////////////////////////////////////////////////////////////// | ||
|
||
export const DELETE = async (event: RequestEvent) => { | ||
const request = event.request; | ||
const data = await request.json(); | ||
|
||
try { | ||
console.log('Inside query server endpoints'); | ||
const response = await deleteQuery(data.sessionId, data.queryId); | ||
return new Response(response.message); | ||
} catch (err) { | ||
console.error(`Error deleting query: ${err.message}`); | ||
return new Response(err.message); | ||
console.log('Inside query server endpoints'); | ||
let response; | ||
try{ | ||
response = await deleteQuery(data.sessionId, data.queryId); | ||
}catch(error){ | ||
throw redirect( | ||
errorMessage('Error deleting query.'), | ||
event | ||
); | ||
} | ||
throw redirect( | ||
successMessage(response.Message), | ||
event | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import type { RequestEvent } from '@sveltejs/kit'; | ||
import { deleteDrug } from '../../services/drugs'; | ||
import { errorMessage, successMessage } from '$lib/utils/message.utils'; | ||
import { redirect } from 'sveltekit-flash-message/server'; | ||
|
||
////////////////////////////////////////////////////////////// | ||
|
||
export const DELETE = async (event: RequestEvent) => { | ||
const request = event.request; | ||
const data = await request.json(); | ||
|
||
try { | ||
console.log('Inside drug server endpoints'); | ||
const response = await deleteDrug(data.sessionId, data.drugId); | ||
return new Response(response.message); | ||
} catch (err) { | ||
console.error(`Error deleting drug: ${err.message}`); | ||
return new Response(err.message); | ||
console.log('Inside drug server endpoints'); | ||
let response; | ||
try{ | ||
response = await deleteDrug(data.sessionId, data.drugId); | ||
}catch(error){ | ||
throw redirect( | ||
errorMessage('Error deleting drug.'), | ||
event | ||
); | ||
} | ||
throw redirect( | ||
successMessage(response.Message), | ||
event | ||
); | ||
}; |
22 changes: 15 additions & 7 deletions
22
src/routes/api/server/gamification/badge-categories/+server.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
import { errorMessage, successMessage } from '$lib/utils/message.utils'; | ||
import { deleteBadgeCategory } from '$routes/api/services/gamification/badge.category'; | ||
import type { RequestEvent } from '@sveltejs/kit'; | ||
import { redirect } from 'sveltekit-flash-message/server'; | ||
|
||
////////////////////////////////////////////////////////////// | ||
|
||
export const DELETE = async (event: RequestEvent) => { | ||
const request = event.request; | ||
const data = await request.json(); | ||
try { | ||
console.log('Inside badge category server endpoints'); | ||
const response = await deleteBadgeCategory(data.sessionId, data.badgeCategoryId); | ||
return new Response(response.message); | ||
} catch (err) { | ||
console.error(`Error deleting badge category: ${err.message}`); | ||
return new Response(err.message); | ||
console.log('Inside badge category server endpoints'); | ||
let response; | ||
try{ | ||
response = await deleteBadgeCategory(data.sessionId, data.badgeCategoryId); | ||
}catch(error){ | ||
throw redirect( | ||
errorMessage('Error deleting badge category.'), | ||
event | ||
); | ||
} | ||
throw redirect( | ||
successMessage(response.Message), | ||
event | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
import { errorMessage, successMessage } from '$lib/utils/message.utils'; | ||
import { deleteBadge } from '$routes/api/services/gamification/badge'; | ||
import type { RequestEvent } from '@sveltejs/kit'; | ||
import { redirect } from 'sveltekit-flash-message/server'; | ||
|
||
////////////////////////////////////////////////////////////// | ||
|
||
export const DELETE = async (event: RequestEvent) => { | ||
const request = event.request; | ||
const data = await request.json(); | ||
try { | ||
console.log('Inside badge server endpoints'); | ||
const response = await deleteBadge(data.sessionId, data.badgeId); | ||
return new Response(response.message); | ||
} catch (err) { | ||
console.error(`Error deleting badge: ${err.message}`); | ||
return new Response(err.message); | ||
console.log('Inside badge server endpoints'); | ||
let response; | ||
try{ | ||
response = await deleteBadge(data.sessionId, data.badgeId); | ||
}catch(error){ | ||
throw redirect( | ||
errorMessage('Error deleting badge.'), | ||
event | ||
); | ||
} | ||
throw redirect( | ||
successMessage(response.Message), | ||
event | ||
); | ||
}; |
Oops, something went wrong.