-
Notifications
You must be signed in to change notification settings - Fork 46
Feature/multi lang template #382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… would not work without reflected changes in package-lock file.
Previously it has not been stopped correctly because docker image with the demo apps ignores SIGTERM cmd.
export async function up(knex: Knex): Promise<void> { | ||
return knex.schema.createTable(tables.templatesLocalized, table => { | ||
table.string('templateName', 50).notNullable().references('templates.name').onDelete('CASCADE'); | ||
table.text('content').notNullable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
table.text('content', 'mediumtext').notNullable();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what means 'mediumtext'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found answer here knex/knex#1064 (comment)
Updated type
…t allows only 64kb of content.
@@ -0,0 +1,4 @@ | |||
export const tables = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the purpose of this file is enumeration of existing tables ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeap, in order not to write string literal every time when table name is needed
export interface LocalizedTemplate { | ||
templateName: string; | ||
content: string; | ||
locale?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if locale is absent I would expect default one.
how to configure default locale ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default locale is specified on content
column of the template
table
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you are right it should be required
|
||
const validateRequestBeforeCreateTemplate = validateRequestFactory([{ | ||
schema: templateSchema, | ||
selector: 'body', | ||
}]); | ||
|
||
const createTemplate = async (req: Request, res: Response): Promise<void> => { | ||
const template = req.body; | ||
const request = req.body; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template
looked like more as an entity the request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't get this one
@@ -43,6 +43,7 @@ describe('ErrorHandler', () => { | |||
}); | |||
|
|||
const response = await server.get('/_ilc/500').expect(500); | |||
console.log(response.text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it expected to be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
No description provided.