fictionco / fiction

(Public Release Summer 2024) Personal Marketing Platform. A powerful platform for your online identity.

Home Page:https://www.fiction.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some Mistakes in the Docs

ianquar opened this issue · comments

It's a greate documentation, When I was reading the Docs I noticed Three things.

1. you writed two times await await in https://factor.dev/docs/database#query-directly-with-mongoose-models

// Import from server-only api
import { getModel } from "@factor/api/server"

// Get a user based on their userId
const getUser = async (_id) => {
  return await await getModel("user").findOne({ _id })
}

// Endpoint to create an attachment
const createAttachment = async (data) => {
  const attachmentModel = getModel("attachment")
  const attachment = new attachmentModel(data)

  return await attachment.save()
}

2. you forget a to declare addPostSchema in https://factor.dev/docs/post-types#schema-definition

import { addPostType, ObjectId } from "@factor/api"


addPostType({
  schemaDefinition: {
    foo: String,
    bar: Buffer,
    baz: Number,
    buz: {ref: "anotherPostType", type: ObjectId}
  },
  schemaMiddleware: Schema => {
    Schema.pre('save', function(){
      // add middleware
    })
  }
  schemaPopulated: {
    buz: "any" // "any" | "list" | "single"
  }
  schemaOptions: {}
  // ...other post type options
})

// Add the schema to factor
addPostSchema(mySchema)

3. Markdown Image Loader link need to be fixed, he is going to the wrong url

<a href="./https://github.com/lucsorel/markdown-image-loader">Markdown Image Loader</a>
you added ./ at the first, I think you mean This
<a href="https://github.com/lucsorel/markdown-image-loader">Markdown Image Loader</a>
at https://factor.dev/docs/markdown#reading-markdown-files

maybe I am wrong I just want to help, thanks for the greate work ;)

@ianquar thank you! All fixed in the latest commit. Keep it up!