Skip to content

sungjkim/APILiveSamples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

APILive Samples

With permission, here are samples of my work done on API Live for American Digital Diversity Initiative. Other colleagues content will generally be commented out and noted as so. Files are organized into React, .NET, & SQL folders. Brief summary of work done:

React

  • Login component pushes currentUser info as state via react router's props.history.push() to a higher AppRoutes component where it updates currentUser state via getDerivedStateFromProps:
static getDerivedStateFromProps(nextProps, prevState) {
const type = nextProps.location.state ? nextProps.location.state.type : "";
switch (type) {
case "login":
return nextProps.location.state.user.id !== prevState.currentUser.id
? {
currentUser: {
isLoggedIn: true,
...nextProps.location.state.user
}
}
: {};
default:
return prevState.currentUser.isLoggedIn
? {
currentUser: {
...prevState.currentUser
}
}
: {};
}
}
  • Dashboards: every dashboard's Main.jsx relies on the subroute to display the component of interest when its respective button is clicked
  • Multi-step event form components located under components/admin/organizationDashboard/event/eventform. Individual step components are imported into EventForm.jsx

.Net

  • BaseApiController created by Project Lead but is provided here for reference
  • AdvertisementDocumentService.cs generally standard CRUD
  • Login service methods located under UserService.cs
  • EventService.cs's Insert method contains handling of the various related table entities that are needed in order to insert an event record. DataTable types are used to handle the user defined table types in SQL

SQL Stored Procedures

  • Users_Insert.sql connects to registration methods in .Net
  • Users_GetPaginatedByUserRole.sql contains paginated example combined with separate set for related multiple users' roles
  • Events_Insert.sql utilizes transaction to rollback any insertions done due to having to insert various table entities
  • Rest are generally standard CRUD stored procedures

About

Snippets of work done on API Live for American Digital Diversity Initiative

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published