feat: add notes field to stocks API upsert
This commit is contained in:
@@ -28,6 +28,7 @@ export async function action({ request }: { request: Request }) {
|
|||||||
const lastExplanation = formData.get("lastExplanation")?.toString();
|
const lastExplanation = formData.get("lastExplanation")?.toString();
|
||||||
const lastExecutionPlan = formData.get("lastExecutionPlan")?.toString();
|
const lastExecutionPlan = formData.get("lastExecutionPlan")?.toString();
|
||||||
const lastJobId = formData.get("lastJobId")?.toString();
|
const lastJobId = formData.get("lastJobId")?.toString();
|
||||||
|
const notes = formData.get("notes")?.toString();
|
||||||
|
|
||||||
// Upsert the stock record so ticker is ensured and optional fields are saved
|
// Upsert the stock record so ticker is ensured and optional fields are saved
|
||||||
const stock = await db.stock.upsert({
|
const stock = await db.stock.upsert({
|
||||||
@@ -37,6 +38,7 @@ export async function action({ request }: { request: Request }) {
|
|||||||
lastExplanation: lastExplanation ?? undefined,
|
lastExplanation: lastExplanation ?? undefined,
|
||||||
lastExecutionPlan: lastExecutionPlan ?? undefined,
|
lastExecutionPlan: lastExecutionPlan ?? undefined,
|
||||||
lastJobId: lastJobId ?? undefined,
|
lastJobId: lastJobId ?? undefined,
|
||||||
|
notes: notes ?? undefined,
|
||||||
},
|
},
|
||||||
create: {
|
create: {
|
||||||
ticker,
|
ticker,
|
||||||
@@ -44,6 +46,7 @@ export async function action({ request }: { request: Request }) {
|
|||||||
lastExplanation: lastExplanation ?? undefined,
|
lastExplanation: lastExplanation ?? undefined,
|
||||||
lastExecutionPlan: lastExecutionPlan ?? undefined,
|
lastExecutionPlan: lastExecutionPlan ?? undefined,
|
||||||
lastJobId: lastJobId ?? undefined,
|
lastJobId: lastJobId ?? undefined,
|
||||||
|
notes: notes ?? undefined,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user