Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

refactor: change user collections min title length to 1

Andrew Bastinb68115d3b23e
diff --git a/packages/hoppscotch-backend/src/user-collection/user-collection.service.spec.ts b/packages/hoppscotch-backend/src/user-collection/user-collection.service.spec.ts
index 8db389b8f..38cc066ca 100644
--- a/packages/hoppscotch-backend/src/user-collection/user-collection.service.spec.ts
+++ b/packages/hoppscotch-backend/src/user-collection/user-collection.service.spec.ts
@@ -495,10 +495,10 @@ describe('getUserRootCollections', () => {
});
describe('createUserCollection', () => {
- test('should throw USER_COLL_SHORT_TITLE when title is less than 3 characters', async () => {
+ test('should throw USER_COLL_SHORT_TITLE when title is an empty string', async () => {
const result = await userCollectionService.createUserCollection(
user,
- 'ab',
+ '',
rootRESTUserCollection.id,
ReqType.REST,
);
@@ -694,7 +694,7 @@ describe('createUserCollection', () => {
});
describe('renameUserCollection', () => {
- test('should throw USER_COLL_SHORT_TITLE when title is less than 3 characters', async () => {
+ test('should throw USER_COLL_SHORT_TITLE when title is empty', async () => {
const result = await userCollectionService.renameUserCollection(
'',
rootRESTUserCollection.id,
diff --git a/packages/hoppscotch-backend/src/user-collection/user-collection.service.ts b/packages/hoppscotch-backend/src/user-collection/user-collection.service.ts
index 3ee6fb026..169f47aa6 100644
--- a/packages/hoppscotch-backend/src/user-collection/user-collection.service.ts
+++ b/packages/hoppscotch-backend/src/user-collection/user-collection.service.ts
@@ -34,7 +34,7 @@ export class UserCollectionService {
private readonly pubsub: PubSubService,
) {}
- TITLE_LENGTH = 3;
+ TITLE_LENGTH = 1;
/**
* Typecast a database UserCollection to a UserCollection model