use greeting from DDB and fix config query
All checks were successful
Build and push image for doorman-homeassistant / docker (push) Successful in 25s
Build and push Doorman UI / API / docker (push) Successful in 1m22s
Build and push image for doorman-homeassistant / deploy-gitainer (push) Successful in 22s

This commit is contained in:
Martin Dimitrov 2024-11-12 22:05:02 -08:00
parent a227f82adb
commit dccd56bfa5
5 changed files with 6 additions and 4 deletions

View File

@ -70,6 +70,7 @@ exports.handler = async function(context, event, callback) {
fallbackNumbers: config.Item.fallbackNumbers.SS,
pressKey: config.Item.pressKey.S,
discordUsers: config.Item?.discordUsers?.SS || [],
greeting: config.Item?.greeting.S || "",
});
}).catch((e) => {

View File

@ -142,7 +142,7 @@ exports.getDoorConfigCommand = (door) => {
S: `door-${door}`,
},
"SK": {
S: "config-update",
S: "config",
},
},
});
@ -167,7 +167,7 @@ exports.replaceDoorConfigWithUpdateItem = (newConfigItem) => {
...newConfigItem.Item,
SK: { S: "config" },
};
delete newItem.approvalId;
return new PutItemCommand({

View File

@ -254,7 +254,7 @@ export function DoorPage() {
>
<SpaceBetween size='l' alignItems="center">
<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>
<img src="/Insulin_Nation_Low_Kramer.gif"/>
</SpaceBetween>

View File

@ -4,7 +4,7 @@ import { DoorResponse } from "../types/DoorResponse";
import { useForm } from "react-hook-form";
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 = () => {
const doorResponse = useLoaderData() as DoorResponse;

View File

@ -6,4 +6,5 @@ export interface DoorResponse {
pressKey: string;
discordUsers: string[];
buzzer: string;
greeting: string;
};