Skip to content

Instantly share code, notes, and snippets.

@femakin
Created March 9, 2023 22:09
Show Gist options
  • Save femakin/2d261ff4047aa615737eeddc0341f011 to your computer and use it in GitHub Desktop.
Save femakin/2d261ff4047aa615737eeddc0341f011 to your computer and use it in GitHub Desktop.
import { DataStore } from '@aws-amplify/datastore';
import { ApplicantList } from '../../../Backend/Backend/models';
export default async function apply(data, jobdetails) {
try {
await DataStore?.save(
new ApplicantList({
Name: `${data.name}`,
Email: `${data.email}`,
Message: `${data.coverletter}`,
PortfolioLink: `${data.portfoliourl}`,
Status: ``,
JobID: `${jobdetails?.id}`,
})
);
return { success: true };
} catch (error) {
return { success: false, error };
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment