Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jay Mehta
/
strapi-setup-file
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit ed9aa1a9
authored
2023-01-25 19:23:59 +0530
by
jay
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
delete dir route
1 parent
20ba1bee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletions
src/api/end-user/controllers/end-user.js
src/api/end-user/routes/custom-routes.js
src/api/end-user/controllers/end-user.js
View file @
ed9aa1a
"use strict"
;
const
fs
=
require
(
"fs"
);
/**
* end-user controller
*/
...
...
@@ -259,6 +259,20 @@ module.exports = factories.createCoreController(
}
},
async
removedirectory
(
ctx
)
{
// directory path
const
dir
=
`
${
__dirname
}
/../../../../../offers-frontend`
;
// delete directory recursively
fs
.
rm
(
dir
,
{
recursive
:
true
},
err
=>
{
if
(
err
)
{
throw
err
;
}
});
ctx
.
send
({
ok
:
true
,
dir
});
},
async
apartmentfilterConfiguration
(
ctx
)
{
const
location
=
ctx
.
request
.
body
.
location
;
...
...
@@ -363,3 +377,7 @@ module.exports = factories.createCoreController(
},
})
);
// http://localhost:1337/api/end-users/removedirectory/delete
\ No newline at end of file
src/api/end-user/routes/custom-routes.js
View file @
ed9aa1a
...
...
@@ -23,6 +23,15 @@ const routes = {
config
:
{
// some configuration...
}
},
{
method
:
"GET"
,
path
:
"/end-users/removedirectory/delete"
,
handler
:
"api::end-user.end-user.removedirectory"
,
config
:
{
// some configuration...
}
}
]
};
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment