MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / getId

Method getId

packages/server/src/api/rest/index.ts:1984–1994  ·  view source on GitHub ↗
(model: string, data: any)

Source from the content-addressed store, hash-verified

1982 }
1983
1984 private getId(model: string, data: any) {
1985 if (!data) {
1986 return undefined;
1987 }
1988 const ids = this.getIdFields(model);
1989 if (ids.length === 0) {
1990 return undefined;
1991 } else {
1992 return data[this.makeIdKey(ids)];
1993 }
1994 }
1995
1996 private async serializeItems(model: string, items: unknown, options?: Partial<SerializerOptions<any>>) {
1997 model = lowerCaseFirst(model);

Callers 2

processNestedCreateMethod · 0.95
buildSerializersMethod · 0.95

Calls 2

getIdFieldsMethod · 0.95
makeIdKeyMethod · 0.95

Tested by

no test coverage detected