fix: Several fixes to store product endpoints, moved several test suites to HTTP (#7601)

* chore: Move publishable api key tests to HTTP

* chore: Move store tests to HTTP folder

* fix: Add tests for store products, fix several bugs around publishable keys
This commit is contained in:
Stevche Radevski
2024-06-04 21:00:07 +02:00
committed by GitHub
parent d104d1a256
commit e44fe78b96
24 changed files with 2301 additions and 2763 deletions

View File

@@ -90,6 +90,17 @@
"default": "now()",
"mappedType": "datetime"
},
"updated_at": {
"name": "updated_at",
"type": "timestamptz",
"unsigned": false,
"autoincrement": false,
"primary": false,
"nullable": false,
"length": 6,
"default": "now()",
"mappedType": "datetime"
},
"revoked_by": {
"name": "revoked_by",
"type": "text",

View File

@@ -0,0 +1,13 @@
import { Migration } from '@mikro-orm/migrations';
export class Migration20240604080145 extends Migration {
async up(): Promise<void> {
this.addSql('alter table if exists "api_key" add column if not exists "updated_at" timestamptz not null default now();');
}
async down(): Promise<void> {
this.addSql('alter table if exists "api_key" drop column if exists "updated_at";');
}
}

View File

@@ -65,6 +65,14 @@ export default class ApiKey {
})
created_at: Date
@Property({
onCreate: () => new Date(),
onUpdate: () => new Date(),
columnType: "timestamptz",
defaultRaw: "now()",
})
updated_at?: Date
@Property({ columnType: "text", nullable: true })
revoked_by: string | null = null