Skip to content

Commit

Permalink
fix: bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
brunozoric committed Nov 10, 2023
1 parent 55fb624 commit 39d2157
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { PageBlockDynamoDbFieldPlugin } from "~/plugins/definitions/PageBlockDyn
import { PluginsContainer } from "@webiny/plugins";
import { createGSIPartitionKey, createGSISortKey, createPartitionKey, createSortKey } from "./keys";
import { PageBlockStorageOperations } from "~/types";
import { put } from "@webiny/db-dynamodb";
import { deleteItem, put } from "@webiny/db-dynamodb";
import { compress, decompress } from "./compression";

const createType = (): string => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ const List = styled("div")`
`;

const ListItem = styled.div`
position: relative;
border: 1px solid rgba(212, 212, 212, 0.5);
box-shadow: 0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%),
0px 1px 3px 0px rgb(0 0 0 / 12%);
min-height: 70px;
padding: 15px;
margin-bottom: 10px;
:last-of-type {
margin-bottom: 0;
}
position: relative;
border: 1px solid rgba(212, 212, 212, 0.5);
box-shadow: 0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%),
0px 1px 3px 0px rgb(0 0 0 / 12%);
min-height: 70px;
padding: 15px;
margin-bottom: 10px;
:last-of-type {
margin-bottom: 0;
}
`;

const ListItemText = styled("div")({
Expand Down
2 changes: 1 addition & 1 deletion packages/db-dynamodb/src/utils/count.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { QueryAllParams } from "~/utils/query";
export const count = async (params: QueryAllParams): Promise<number> => {
const { entity, partitionKey, options = {} } = params;
const { Count } = await entity.query(partitionKey, { ...options, select: "count" });
return Count;
return Count || 0;
};
1 change: 1 addition & 0 deletions packages/db-dynamodb/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export * from "./put";
export * from "./listResponse";
export * from "./query";
export * from "./count";
export * from "./scan";
export * from "./sort";
export * from "./table";
export * from "./update";
6 changes: 3 additions & 3 deletions packages/migrations/src/migrations/5.38.0/003/ddb/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Table } from "dynamodb-toolbox";
import { Table } from "@webiny/db-dynamodb/toolbox";
import { inject, makeInjectable } from "@webiny/ioc";
import { executeWithRetry } from "@webiny/utils";
import {
Expand All @@ -24,9 +24,9 @@ const isGroupMigrationCompleted = (
export class PageBlocks_5_38_0_003 implements DataMigration {
private readonly oldPageBlockEntity: ReturnType<typeof createOldPageBlockEntity>;
private readonly newPageBlockEntity: ReturnType<typeof createNewPageBlockEntity>;
private readonly table: Table;
private readonly table: Table<string, string, string>;

constructor(table: Table) {
constructor(table: Table<string, string, string>) {
this.table = table;
this.oldPageBlockEntity = createOldPageBlockEntity(table);
this.newPageBlockEntity = createNewPageBlockEntity(table);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Table } from "dynamodb-toolbox";
import { EntityAttributes } from "dynamodb-toolbox/dist/classes/Entity";
import { Table, AttributeDefinitions } from "@webiny/db-dynamodb/toolbox";
import { createLegacyEntity } from "~/utils";

const oldAttributes: EntityAttributes = {
const oldAttributes: AttributeDefinitions = {
PK: {
partitionKey: true
},
Expand Down Expand Up @@ -41,11 +40,11 @@ const oldAttributes: EntityAttributes = {
}
};

export const createOldPageBlockEntity = (table: Table) => {
export const createOldPageBlockEntity = (table: Table<string, string, string>) => {
return createLegacyEntity(table, "PbPageBlocks", oldAttributes);
};

export const createNewPageBlockEntity = (table: Table) => {
export const createNewPageBlockEntity = (table: Table<string, string, string>) => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { preview, ...attrs } = oldAttributes;

Expand Down
1 change: 0 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15125,7 +15125,6 @@ __metadata:
rimraf: ^3.0.2
slugify: ^1.2.9
store: ^2.0.12
timeago-react: ^2.0.0
ttypescript: ^1.5.12
typescript: 4.7.4
zod: ^3.21.4
Expand Down

0 comments on commit 39d2157

Please sign in to comment.