[PR #3504] [MERGED] feat: introducing shortcode into admin module #4411

Closed
opened 2026-03-17 01:57:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3504
Author: @balub
Created: 11/7/2023
Status: Merged
Merged: 11/10/2023
Merged by: @balub

Base: release/2023.12.0Head: feat/admin-shortcodes


📝 Commits (9)

  • a353835 feat: added query in infra to fetch all shortcodes
  • 3503130 feat: added mutation in admin to delete shortcode
  • 2b6422f chore: added new tests for methods in shortcode module
  • 47acfbe chore: removed .vscode file
  • 49d85be chore: added a new ShortcodeCreator type to output of fetchAllShortcodes query
  • 29f572a chore: shortcodeCreator type is now nullable
  • 96240ab chore: added type defs to fetchAllShortcodes method in admin module
  • 8b2c271 docs: update code comments
  • 9ea4966 chore: changed target to prod in hoppscotch-old-backend

📊 Changes

10 files changed (+323 additions, -19 deletions)

View changed files

.vscode/extensions.json (+0 -14)
📝 packages/hoppscotch-backend/src/admin/admin.module.ts (+2 -0)
📝 packages/hoppscotch-backend/src/admin/admin.resolver.ts (+17 -0)
📝 packages/hoppscotch-backend/src/admin/admin.service.spec.ts (+3 -0)
📝 packages/hoppscotch-backend/src/admin/admin.service.ts (+33 -0)
📝 packages/hoppscotch-backend/src/admin/infra.resolver.ts (+20 -0)
📝 packages/hoppscotch-backend/src/shortcode/shortcode.model.ts (+44 -0)
📝 packages/hoppscotch-backend/src/shortcode/shortcode.resolver.ts (+3 -2)
📝 packages/hoppscotch-backend/src/shortcode/shortcode.service.spec.ts (+126 -1)
📝 packages/hoppscotch-backend/src/shortcode/shortcode.service.ts (+75 -2)

📄 Description

Closes HBE-289

Description

In this PR we introduce queries and mutations into the Infra and Admin types respectively to be able to view and delete shortcodes present in the database. The allShortcodes query in the Infra type returns a new Shortcode type with creatorUid and creatorEmail properties added in addition to the usual Shortcode properties to satisfy requirements stated in ticket.

type ShortcodeWithUserEmail {
	id: ID!
	request: String!
	properties: String?
	createdOn: DateTime!
        creatorUid: String!
       creatorEmail: String!
}

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

Additional Information


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/3504 **Author:** [@balub](https://github.com/balub) **Created:** 11/7/2023 **Status:** ✅ Merged **Merged:** 11/10/2023 **Merged by:** [@balub](https://github.com/balub) **Base:** `release/2023.12.0` ← **Head:** `feat/admin-shortcodes` --- ### 📝 Commits (9) - [`a353835`](https://github.com/hoppscotch/hoppscotch/commit/a3538350436a9be398de3a31a1c2af1605311546) feat: added query in infra to fetch all shortcodes - [`3503130`](https://github.com/hoppscotch/hoppscotch/commit/3503130b7d5886b6cecfdb2e6255ade2f37fde0e) feat: added mutation in admin to delete shortcode - [`2b6422f`](https://github.com/hoppscotch/hoppscotch/commit/2b6422f19c70f5ac7671b6d91ea47c42b8a7e56a) chore: added new tests for methods in shortcode module - [`47acfbe`](https://github.com/hoppscotch/hoppscotch/commit/47acfbecabbb9ade42dbe605aedac822d84d5af7) chore: removed .vscode file - [`49d85be`](https://github.com/hoppscotch/hoppscotch/commit/49d85beb72ce9a53b97c2264e18a6b54e0c8dc4f) chore: added a new ShortcodeCreator type to output of fetchAllShortcodes query - [`29f572a`](https://github.com/hoppscotch/hoppscotch/commit/29f572a3b631f06ee3cc584d885b70dc7f9f5bb2) chore: shortcodeCreator type is now nullable - [`96240ab`](https://github.com/hoppscotch/hoppscotch/commit/96240ab9b410c883e6c1c273ca8c36b4ee5ca2b6) chore: added type defs to fetchAllShortcodes method in admin module - [`8b2c271`](https://github.com/hoppscotch/hoppscotch/commit/8b2c2718c1283ba47011631a885e8d92e35326d7) docs: update code comments - [`9ea4966`](https://github.com/hoppscotch/hoppscotch/commit/9ea4966d2ed71415ab588d57892215dfe3ef3158) chore: changed target to prod in hoppscotch-old-backend ### 📊 Changes **10 files changed** (+323 additions, -19 deletions) <details> <summary>View changed files</summary> ➖ `.vscode/extensions.json` (+0 -14) 📝 `packages/hoppscotch-backend/src/admin/admin.module.ts` (+2 -0) 📝 `packages/hoppscotch-backend/src/admin/admin.resolver.ts` (+17 -0) 📝 `packages/hoppscotch-backend/src/admin/admin.service.spec.ts` (+3 -0) 📝 `packages/hoppscotch-backend/src/admin/admin.service.ts` (+33 -0) 📝 `packages/hoppscotch-backend/src/admin/infra.resolver.ts` (+20 -0) 📝 `packages/hoppscotch-backend/src/shortcode/shortcode.model.ts` (+44 -0) 📝 `packages/hoppscotch-backend/src/shortcode/shortcode.resolver.ts` (+3 -2) 📝 `packages/hoppscotch-backend/src/shortcode/shortcode.service.spec.ts` (+126 -1) 📝 `packages/hoppscotch-backend/src/shortcode/shortcode.service.ts` (+75 -2) </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes HBE-289 ### Description <!-- Add a brief description of the pull request --> In this PR we introduce queries and mutations into the `Infra` and `Admin` types respectively to be able to view and delete shortcodes present in the database. The `allShortcodes` query in the `Infra` type returns a new `Shortcode` type with `creatorUid` and `creatorEmail` properties added in addition to the usual `Shortcode` properties to satisfy requirements stated in ticket. ``` type ShortcodeWithUserEmail { id: ID! request: String! properties: String? createdOn: DateTime! creatorUid: String! creatorEmail: String! } ``` <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [ ] Not Completed - [x] Completed --> ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] My pull request adheres to the code style of this project - [ ] My code requires changes to the documentation - [ ] I have updated the documentation as required - [x] All the tests have passed ### Additional Information <!-- Any additional information like breaking changes, dependencies added, screenshots, comparisons between new and old behaviour, etc. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:57:07 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4411
No description provided.