use greeting from DDB and fix config query
This commit is contained in:
parent
a227f82adb
commit
dccd56bfa5
@ -70,6 +70,7 @@ exports.handler = async function(context, event, callback) {
|
|||||||
fallbackNumbers: config.Item.fallbackNumbers.SS,
|
fallbackNumbers: config.Item.fallbackNumbers.SS,
|
||||||
pressKey: config.Item.pressKey.S,
|
pressKey: config.Item.pressKey.S,
|
||||||
discordUsers: config.Item?.discordUsers?.SS || [],
|
discordUsers: config.Item?.discordUsers?.SS || [],
|
||||||
|
greeting: config.Item?.greeting.S || "",
|
||||||
});
|
});
|
||||||
|
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
|
|||||||
@ -142,7 +142,7 @@ exports.getDoorConfigCommand = (door) => {
|
|||||||
S: `door-${door}`,
|
S: `door-${door}`,
|
||||||
},
|
},
|
||||||
"SK": {
|
"SK": {
|
||||||
S: "config-update",
|
S: "config",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -167,7 +167,7 @@ exports.replaceDoorConfigWithUpdateItem = (newConfigItem) => {
|
|||||||
...newConfigItem.Item,
|
...newConfigItem.Item,
|
||||||
SK: { S: "config" },
|
SK: { S: "config" },
|
||||||
};
|
};
|
||||||
|
|
||||||
delete newItem.approvalId;
|
delete newItem.approvalId;
|
||||||
|
|
||||||
return new PutItemCommand({
|
return new PutItemCommand({
|
||||||
|
|||||||
@ -254,7 +254,7 @@ export function DoorPage() {
|
|||||||
>
|
>
|
||||||
<SpaceBetween size='l' alignItems="center">
|
<SpaceBetween size='l' alignItems="center">
|
||||||
<TextContent>
|
<TextContent>
|
||||||
That's it! Enter the building and hit floor 11 on the elevator. We are unit 1105, just to the left off the elevator
|
{doorResponse.greeting || "The door is unlocked!"}
|
||||||
</TextContent>
|
</TextContent>
|
||||||
<img src="/Insulin_Nation_Low_Kramer.gif"/>
|
<img src="/Insulin_Nation_Low_Kramer.gif"/>
|
||||||
</SpaceBetween>
|
</SpaceBetween>
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { DoorResponse } from "../types/DoorResponse";
|
|||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { InputTokenGroup } from "../components/InputTokenGroup";
|
import { InputTokenGroup } from "../components/InputTokenGroup";
|
||||||
|
|
||||||
export type DoorEditForm = DoorResponse & { pin: string, fallbackNumber: string, discordUser: string, greeting: string };
|
export type DoorEditForm = DoorResponse & { pin: string, fallbackNumber: string, discordUser: string };
|
||||||
|
|
||||||
export const EditPage = () => {
|
export const EditPage = () => {
|
||||||
const doorResponse = useLoaderData() as DoorResponse;
|
const doorResponse = useLoaderData() as DoorResponse;
|
||||||
|
|||||||
@ -6,4 +6,5 @@ export interface DoorResponse {
|
|||||||
pressKey: string;
|
pressKey: string;
|
||||||
discordUsers: string[];
|
discordUsers: string[];
|
||||||
buzzer: string;
|
buzzer: string;
|
||||||
|
greeting: string;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user