Reorganize repo structure and standards references
This commit is contained in:
1 parent
3cb93a81be
commit
be2054274d
5885 files changed
+2588
-195
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { getDbClient } from "./client.server.js";
|
||||
|
||||
export type LegacyWidget = {
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
tenantId: string | null;
|
||||
name: string;
|
||||
appearance: string;
|
||||
metadata: string;
|
||||
};
|
||||
|
||||
export type LegacyWidgetReaderClient = {
|
||||
widget: {
|
||||
findFirst(args: {
|
||||
where: { id: string; tenantId: string };
|
||||
}): Promise<LegacyWidget | null>;
|
||||
};
|
||||
};
|
||||
|
||||
export type LegacyWidgetLookup = {
|
||||
widgetId: string;
|
||||
tenantId: string;
|
||||
};
|
||||
|
||||
export async function findLegacyWidgetById(
|
||||
{ widgetId, tenantId }: LegacyWidgetLookup,
|
||||
client: LegacyWidgetReaderClient = getDbClient(),
|
||||
): Promise<LegacyWidget | null> {
|
||||
return client.widget.findFirst({
|
||||
where: { id: widgetId, tenantId },
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user