mirror of
https://github.com/System-End/slack-end.git
synced 2026-04-19 23:22:56 +00:00
fix: uh default data is broken
This commit is contained in:
parent
bb4edd3588
commit
b9b7a54540
1 changed files with 2 additions and 2 deletions
|
|
@ -217,7 +217,7 @@ export function diffAirtable(
|
|||
): string[] {
|
||||
const msgs: string[] = [];
|
||||
for (const key in newD.fields) {
|
||||
if (old.fields[key] !== newD.fields[key]) {
|
||||
if (old?.fields[key] !== newD.fields[key]) {
|
||||
msgs.push(
|
||||
`*${key}* changed from \`${JSON.stringify(old.fields[key])}\` to \`${JSON.stringify(newD.fields[key])}\``,
|
||||
);
|
||||
|
|
@ -227,7 +227,7 @@ export function diffAirtable(
|
|||
}
|
||||
export async function cronForAirtable(app: ModifiedApp) {
|
||||
const data: AirtableResponse = await fetchPerson();
|
||||
const old: AirtableResponse = app.dbs.highseas.get("airtable") || {};
|
||||
const old: AirtableResponse = app.dbs.highseas.get("airtable") || { fields: {} };
|
||||
const diffMessages = diffAirtable(old, data);
|
||||
if (diffMessages.length > 0) {
|
||||
app.client.chat
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue