|
Post by Mitu46544 on Nov 8, 2023 14:51:46 GMT 8
及其作者信息。您已添加查询以将数据加载到您的应用程序中。此时您的应用程序应该能够从数据库中获取已发布和未发布的帖子。当您选择单个帖子时您还应该能够查看它们的详细信息。定义动作函数操作是一个仅用于处理数据突变的服务器函数。操作执行对您的路由发出的非请求。操作在各自的路由文件夹中创建的文件。 中定义这些文件将充 马来西亚电话号码表 当您的操作。对于此项目您将实施以下操作行动路线操作网址请求类型描述路由创建默认邮政在您的数据库中创建一个新帖子路线发布帖子放通过帖子发布帖子路线删除帖子删除通过帖子删除帖子路线注册默认邮政创建一个新用户在数据库中创建一个新帖子在文件夹内创建一个文件并添加以下代码复制上面的代码片段执行以下操作声明一个操作以在数据库中创建新帖子。该操作接收一个对象允许您从的表单中读取数据。为任何缺少的必需输。 入添加验证检查。该函数将向客户端返回状态代码和数据。为非字符串值的条目添加类型检查。使用请求正文查询数据库期望必填帖子标题必填帖子内容必填创建帖子的用户的电子邮件该用户应该已经存在执行查询后抛出重定向到路由。单击按钮并填写表格以创建新帖子。提交后您的帖子应该会出现在路线上。按其发布和删除帖子在文件夹内的现有文件中添加以下代码复制该代码片段执行以下操作导入和实用程序。操作定义一个查询查找帖子并将已发布属性更新为。
|
|