1
0
Fork 0
mirror of synced 2024-09-20 19:33:10 +12:00

Change id

This commit is contained in:
Adria Navarro 2024-07-11 15:34:48 +02:00
parent 3bcbb57baa
commit de04a6f76d
3 changed files with 6 additions and 5 deletions

View file

@ -88,7 +88,7 @@ describe("/rowsActions", () => {
const res = await createRowAction(tableId, rowAction, { status: 201 }) const res = await createRowAction(tableId, rowAction, { status: 201 })
expect(res).toEqual({ expect(res).toEqual({
_id: `${tableId}_row_actions`, _id: `ra_${tableId}`,
_rev: expect.stringMatching(/^1-\w+/), _rev: expect.stringMatching(/^1-\w+/),
actions: [ actions: [
{ {
@ -110,7 +110,7 @@ describe("/rowsActions", () => {
const res = await createRowAction(tableId, rowActions[2]) const res = await createRowAction(tableId, rowActions[2])
expect(res).toEqual({ expect(res).toEqual({
_id: `${tableId}_row_actions`, _id: `ra_${tableId}`,
_rev: expect.stringMatching(/^3-\w+/), _rev: expect.stringMatching(/^3-\w+/),
actions: rowActions.map(a => ({ actions: rowActions.map(a => ({
id: expect.any(String), id: expect.any(String),
@ -135,7 +135,7 @@ describe("/rowsActions", () => {
const res2 = await createRowAction(otherTableId, rowAction2) const res2 = await createRowAction(otherTableId, rowAction2)
expect(res1).toEqual({ expect(res1).toEqual({
_id: `${tableId}_row_actions`, _id: `ra_${tableId}`,
_rev: expect.stringMatching(/^1-\w+/), _rev: expect.stringMatching(/^1-\w+/),
actions: [ actions: [
{ {
@ -149,7 +149,7 @@ describe("/rowsActions", () => {
}) })
expect(res2).toEqual({ expect(res2).toEqual({
_id: `${otherTableId}_row_actions`, _id: `ra_${otherTableId}`,
_rev: expect.stringMatching(/^1-\w+/), _rev: expect.stringMatching(/^1-\w+/),
actions: [ actions: [
{ {

View file

@ -355,5 +355,5 @@ export function isRelationshipColumn(
* @returns The new row actions ID which the row actions doc can be stored under. * @returns The new row actions ID which the row actions doc can be stored under.
*/ */
export function generateRowActionsID(tableId: string) { export function generateRowActionsID(tableId: string) {
return `${tableId}${SEPARATOR}row_actions` return `${DocumentType.ROW_ACTIONS}${SEPARATOR}${tableId}`
} }

View file

@ -39,6 +39,7 @@ export enum DocumentType {
AUDIT_LOG = "al", AUDIT_LOG = "al",
APP_MIGRATION_METADATA = "_design/migrations", APP_MIGRATION_METADATA = "_design/migrations",
SCIM_LOG = "scimlog", SCIM_LOG = "scimlog",
ROW_ACTIONS = "ra",
} }
// these are the core documents that make up the data, design // these are the core documents that make up the data, design