Skip to content

Instantly share code, notes, and snippets.

@femakin
Created March 9, 2023 22:10
Show Gist options
  • Save femakin/0f4c1dcdf1ab318327edd4c2cb3d3be1 to your computer and use it in GitHub Desktop.
Save femakin/0f4c1dcdf1ab318327edd4c2cb3d3be1 to your computer and use it in GitHub Desktop.
import { DataStore } from "@aws-amplify/datastore";
import { JobList } from "../../../Backend/Backend/models";
export default async function addnewjob(data) {
try {
await DataStore.save(
new JobList({
JobPosition: `${data.jobPosition}`,
Category: `${data.Category}`,
Location: `${data.Location}`,
Experience: `${data.Experience}`,
JobStatus: `${data.JobStatus}`,
Agency: `${data.Agency}`,
Description: `${data.Description}`,
})
);
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