Skip to content

Commit

Permalink
Merge pull request #86 from arati-tekdi/main
Browse files Browse the repository at this point in the history
Change in regex to support identifier with special char like " : "
  • Loading branch information
Shubham4026 authored Feb 24, 2025
2 parents 2be0956 + 1383e6b commit f02b9e5
Show file tree
Hide file tree
Showing 3 changed files with 1,515 additions and 14 deletions.
12 changes: 7 additions & 5 deletions src/common/middleware/apiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ export const apiList = {
},
'/object/category/definition/v4/read',
),

'/action/asset/v1/create': createRouteObject(
{
post: {
Expand Down Expand Up @@ -1228,22 +1229,23 @@ export const apiList = {
},
'/object/category/definition/v4/create',
),
'/api/object/category/definition/v1/update': createRouteObject(
'/api/object/category/definition/v1/update/:identifier': createRouteObject(
{
patch: {
...common_role_check,
},
},
'/object/category/definition/v4/update',
'/object/category/definition/v4/update/:identifier',
),
'/api/object/category/definition/v1/update/:identifier': createRouteObject(
'/api/object/category/definition/v1/update': createRouteObject(
{
patch: {
...common_role_check,
},
},
'/object/category/definition/v4/update/:identifier',
'/object/category/definition/v4/update',
),

'/api/object/category/definition/v1/read/:identifier': createRouteObject(
{
get: {
Expand Down Expand Up @@ -1644,7 +1646,7 @@ export const apiListForAcademicYear = [
];

function convertToRegex(pattern) {
const regexString = pattern.replace(/:[^\s/]+/g, '([\\w-]+)');
const regexString = pattern.replace(/:[^\s/]+/g, '([\\w:-]+)');
return new RegExp(`^${regexString}$`);
}

Expand Down
Loading

0 comments on commit f02b9e5

Please sign in to comment.