Skip to content
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

PDF Generator #23

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

PDF Generator #23

wants to merge 3 commits into from

Conversation

mateuszCabala95
Copy link
Collaborator

No description provided.

@@ -0,0 +1,14 @@
import * as hbs from "handlebars"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

czy tak nie zadziała?

Suggested change
import * as hbs from "handlebars"
import hbs from "handlebars"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

może handlebars będzie jednak lepszą opcja niż skrótowiec, zwłaszcza że użyte jest tylko raz a łatwiej ogarnąć w kodzie że chodzi o handlebars hbs nie wiele mówi :)

@@ -0,0 +1,14 @@
import * as hbs from "handlebars"
import fs from "fs-extra"
import * as path from "path"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

czy tak nie zadziała?

Suggested change
import * as path from "path"
import path from "path"

import fs from "fs-extra"
import * as path from "path"

const compileHBStoHTML = async (templateName: Handlebars.Template, data: any): Promise<string> => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compiletHandlebarstoHTML, co o tym myślisz?

@@ -0,0 +1,23 @@
import * as puppeteer from "puppeteer"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

czy jest jakiś powód dla takiej formy importów? :)

Add Ticket interface
import path from "path"
import ITicketData from "./TicketData.inteface";

const compileHandlebarsToHTML = async (templateName: Handlebars.Template, data: ITicketData): Promise<string> => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nazwij plik tak jak nazwa funkcji

@@ -0,0 +1,23 @@
import puppeteer from "puppeteer"

const PdfPrinter = async (HTMLToPrint: any): Promise<void> => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nazwa funkcji i pliku z małej litery. Przyjęło się, że pierwsza duża litera jest zarezerwowana dla klas, typów, interfejsów

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tu stringa przekazujesz, nie any

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants