Skip to content

Commit

Permalink
Implemented: unify the use if [id] in urls #101
Browse files Browse the repository at this point in the history
  • Loading branch information
rizen committed Apr 11, 2024
1 parent 41de7f9 commit f2cd1ef
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ outline: deep
## 2024-04-11
* Made currentUserStore more fault tollerant.
* Implemented: add required to FormSelect #95
* Implemented: unify the use if [id] in urls #101
* NOTE: Due to the above change, you should move [id].get.mjs, [id].put.mjs, and [id].delete.mjs in your server/api/v1/record folders to [id]/index.get.mjs, [id]/index.put.mjs, and [id]/index.delete.mjs.

## 2024-04-10
* Implemented: filterQualifier: true should be in the examples for all relation ids #96
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions ving/generator/nuxtapis.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ export const generateRest = (params) => {
const context = { ...getContext({}), ...params };
const folderName = `server/api/${ving.getConfig().rest.version}/${context.name.toLowerCase()}`;
let gen = Promise.resolve(context);
let filePath = `${folderName}/[id].delete.mjs`;
let filePath = `${folderName}/[id]/index.delete.mjs`;
if (!(params.skipExisting && fs.existsSync(filePath)))
gen = gen.then(renderTemplate(idDeleteTemplate, toFile(filePath)));
filePath = `${folderName}/[id].get.mjs`;
filePath = `${folderName}/[id]/index.get.mjs`;
if (!(params.skipExisting && fs.existsSync(filePath)))
gen = gen.then(renderTemplate(idGetTemplate, toFile(filePath)));
filePath = `${folderName}/[id].put.mjs`;
filePath = `${folderName}/[id]/index.put.mjs`;
if (!(params.skipExisting && fs.existsSync(filePath)))
gen = gen.then(renderTemplate(idPutTemplate, toFile(filePath)));
filePath = `${folderName}/index.get.mjs`;
Expand Down

0 comments on commit f2cd1ef

Please sign in to comment.