mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-29 00:16:39 +01:00
fix secret getter example code
This commit is contained in:
@@ -107,7 +107,7 @@ const Settings = ({ config, onChange }) => {
|
||||
? config.derivativeFn
|
||||
: config?.script
|
||||
? `const action:Action = async ({row,ref,db,storage,auth,actionParams,user}) => {
|
||||
${config.script.replace(/utilFns.getSecret/g, "rowy.secrets.getSecret")}
|
||||
${config.script.replace(/utilFns.getSecret/g, "rowy.secrets.get")}
|
||||
}`
|
||||
: RUN_ACTION_TEMPLATE;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export const RUN_ACTION_TEMPLATE = `const action:Action = async ({row,ref,db,storage,auth,actionParams,user}) => {
|
||||
// Write your action code here
|
||||
// for example:
|
||||
// const authToken = await rowy.secrets.getSecret("service")
|
||||
// const authToken = await rowy.secrets.get("service")
|
||||
// try {
|
||||
// const resp = await fetch('https://example.com/api/v1/users/'+ref.id,{
|
||||
// method: 'PUT',
|
||||
@@ -29,7 +29,7 @@ export const RUN_ACTION_TEMPLATE = `const action:Action = async ({row,ref,db,sto
|
||||
export const UNDO_ACTION_TEMPLATE = `const action : Action = async ({row,ref,db,storage,auth,actionParams,user}) => {
|
||||
// Write your undo code here
|
||||
// for example:
|
||||
// const authToken = await rowy.secrets.getSecret("service")
|
||||
// const authToken = await rowy.secrets.get("service")
|
||||
// try {
|
||||
// const resp = await fetch('https://example.com/api/v1/users/'+ref.id,{
|
||||
// method: 'DELETE',
|
||||
|
||||
@@ -58,7 +58,7 @@ export default function Settings({
|
||||
? config.derivativeFn
|
||||
: config?.script
|
||||
? `const derivative:Derivative = async ({row,ref,db,storage,auth})=>{
|
||||
${config.script.replace(/utilFns.getSecret/g, "rowy.secrets.getSecret")}
|
||||
${config.script.replace(/utilFns.getSecret/g, "rowy.secrets.get")}
|
||||
}`
|
||||
: `const derivative:Derivative = async ({row,ref,db,storage,auth})=>{
|
||||
// Write your derivative code here
|
||||
|
||||
Reference in New Issue
Block a user