Skip to content
This repository was archived by the owner on Oct 9, 2024. It is now read-only.

Commit 75b3a6b

Browse files
committed
v2.0.2
1 parent fd38d3a commit 75b3a6b

File tree

9 files changed

+14
-6
lines changed

9 files changed

+14
-6
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# 🛠️ CHANGELOG
22

3+
## v2.0.2
4+
5+
- Ensure API routes have `application/json` header
6+
7+
- Fix `printer prisma` `?` error
8+
39
## v2.0.1
410

511
- Fix injectable formatting issues

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
## Automation Tooling for Next, Redux and Prisma
66

77
![license](https://img.shields.io/badge/license-AGPLv3-blue.svg)
8-
![version](https://img.shields.io/badge/version-2.0.0-blue.svg)
8+
![version](https://img.shields.io/badge/version-2.0.2-blue.svg)
99
[![CircleCI](https://circleci.com/gh/PrinterFramework/CLI.svg?style=svg)](https://circleci.com/gh/PrinterFramework/CLI)
1010
[![codecov](https://codecov.io/gh/PrinterFramework/CLI/branch/master/graph/badge.svg)](https://codecov.io/gh/PrinterFramework/CLI)
1111

dist/src/generators/prisma.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/generators/prisma.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/printer.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/templates/api.template

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export async function GET(req: NextRequest) {
55
const res = new NextResponse()
66
const session = await getSession(req, res)
77
const { searchParams } = new URL(req.url)
8+
res.headers.set('Content-Type', 'application/json')
89

910
try {
1011
return createResponse(

src/generators/prisma.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function formatModel (models: ModelType[]): ModelType[] {
3434
const names = models.map((item) => item.name.toUpperCase())
3535

3636
for (const model of models) {
37-
const type = model.type.toUpperCase().trim()
37+
const type = model.type.toUpperCase().trim().replaceAll('?', '')
3838
const tm = type.replaceAll('[]', '')
3939
let imported = false
4040
let newType = 'any'

src/printer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { SuperagentTypes, injectSupergent } from './generators/superagent'
1717
export const Printer = new Command('🖨️ Printer')
1818

1919
Printer
20-
.version('2.0.1')
20+
.version('2.0.2')
2121
.description('🖨️ Printer: Automation Tooling for Next, Redux and Prisma.')
2222
.option('-a, --no-action', 'do not inject actions', false)
2323
.option('-s, --no-state', 'do not inject state', false)

src/templates/api.template

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export async function GET(req: NextRequest) {
55
const res = new NextResponse()
66
const session = await getSession(req, res)
77
const { searchParams } = new URL(req.url)
8+
res.headers.set('Content-Type', 'application/json')
89

910
try {
1011
return createResponse(

0 commit comments

Comments
 (0)